Skip to content

Commit

Permalink
#1409 - fixed incorrect example code
Browse files Browse the repository at this point in the history
  • Loading branch information
yairEO committed Nov 23, 2024
1 parent 9743bab commit bc63229
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,9 @@ var formElm = document.forms[0]; // just an example
tagify.on('keydown', onTagifyKeyDown)
function onTagifyKeyDown(e){
if( e.key == 'Enter' && // "enter" key pressed
!tagify.state.inputText && // assuming user is not in the middle or adding a tag
!tagify.state.editing // user not editing a tag
if( e.detail.event.key == 'Enter' && // "enter" key pressed
!tagify.state.inputText && // assuming user is not in the middle or adding a tag
!tagify.state.editing // user not editing a tag
){
setTimeout(() => formElm.submit()) // put some buffer to make sure tagify has done with whatever, to be on the safe-side
}
Expand Down

0 comments on commit bc63229

Please sign in to comment.