Skip to content

Commit

Permalink
should set the selectOption on the global state every time `suggest…
Browse files Browse the repository at this point in the history
…ionClick` is called (before it is called), which can be either by mouse click or key press
  • Loading branch information
yairEO committed Nov 10, 2024
1 parent 3e90111 commit 34e81db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parts/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ export default {
case 'Enter' : {
e.preventDefault()

// temporary set the "actions" state to indicate to the main "blur" event it shouldn't execute any if its logic.
// a `100ms` is a good-enough timeout after some testing
this.state.actions.selectOption = true;
setTimeout(()=> this.state.actions.selectOption = false, 100)

_s.hooks.suggestionClick(e, {tagify:this, tagData:selectedElmData, suggestionElm:selectedElm})
.then(() => {
if( selectedElm ){
Expand Down

0 comments on commit 34e81db

Please sign in to comment.