Skip to content

Commit

Permalink
fixes an issue when editing a tag and hitting TAB or ENTER key to app…
Browse files Browse the repository at this point in the history
…ly the change, it won't do anything since the tag was never blurred. Also decreased the `EDITED_TAG_BLUR_DELAY` to `0` for better responsiveness
  • Loading branch information
yairEO committed Jan 29, 2024
1 parent 5d21ba2 commit 7c63fec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,12 +965,12 @@ export default {
case 'Tab' : {
e.preventDefault()

var EDITED_TAG_BLUR_DELAY = 100;
var EDITED_TAG_BLUR_DELAY = 0;

// a setTimeout is used so when editing (in "select" mode) while the dropdown is shown and a suggestion is highlighted
// and ENTER key is pressed down - the `dropdown.hide` method won't be invoked immediately and unbind the dropdown's
// KEYDOWN "ENTER" before it has time to call the handler and select the suggestion.
setTimeout(e.target.blur, EDITED_TAG_BLUR_DELAY)
setTimeout(() => e.target.blur(), EDITED_TAG_BLUR_DELAY)
}
}
},
Expand Down

0 comments on commit 7c63fec

Please sign in to comment.