Skip to content

Commit

Permalink
Fix broken commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Massi-X committed Nov 25, 2024
1 parent 2b66604 commit d9926e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/parts/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,6 @@ export default {
isMixMode = _s.mode == 'mix',
tagData = this.suggestedListItems.find(item => (item.value ?? item) == value)

// select mode: reset the dropdown to show all options again to the user
if(_s.mode == 'select' && !this.state.composing && this.userInput) {
setTimeout(() => {
setTimeout(() => closeOnSelect ? this.dropdown.hide() : this.dropdown.show(), 0)
this.DOM.scope.querySelector('.' + _s.classNames.tagText).focus() //set the focus back to input on each select to ensure consistent behavior
}, 0)
return;
}

// The below event must be triggered, regardless of anything else which might go wrong
this.trigger('dropdown:select', {data:tagData, elm, event})

Expand Down Expand Up @@ -332,6 +323,10 @@ export default {
this.toggleFocusClass(true)
})

// select mode: reset the dropdown to show all options again to the user
if(_s.mode == 'select' && !this.state.composing && this.userInput)
setTimeout(() => this.DOM.scope.querySelector('.' + _s.classNames.tagText).focus(), 0) //set the focus back to input on each select to ensure consistent behavior

closeOnSelect && setTimeout(this.dropdown.hide.bind(this))

// execute these tasks once a suggestion has been selected
Expand Down
2 changes: 1 addition & 1 deletion src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ Tagify.prototype = {
this.removeTags(tagElm)

this.trigger("edit:updated", eventData)
this.dropdown.hide()
closeOnSelect && this.dropdown.hide()

// check if any of the current tags which might have been marked as "duplicate" should be now un-marked
if( this.settings.keepInvalidTags )
Expand Down

0 comments on commit d9926e0

Please sign in to comment.