Skip to content

Commit d9926e0

Browse files
committed
Fix broken commit
1 parent 2b66604 commit d9926e0

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/parts/suggestions.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,6 @@ export default {
295295
isMixMode = _s.mode == 'mix',
296296
tagData = this.suggestedListItems.find(item => (item.value ?? item) == value)
297297

298-
// select mode: reset the dropdown to show all options again to the user
299-
if(_s.mode == 'select' && !this.state.composing && this.userInput) {
300-
setTimeout(() => {
301-
setTimeout(() => closeOnSelect ? this.dropdown.hide() : this.dropdown.show(), 0)
302-
this.DOM.scope.querySelector('.' + _s.classNames.tagText).focus() //set the focus back to input on each select to ensure consistent behavior
303-
}, 0)
304-
return;
305-
}
306-
307298
// The below event must be triggered, regardless of anything else which might go wrong
308299
this.trigger('dropdown:select', {data:tagData, elm, event})
309300

@@ -332,6 +323,10 @@ export default {
332323
this.toggleFocusClass(true)
333324
})
334325

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

337332
// execute these tasks once a suggestion has been selected

src/tagify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ Tagify.prototype = {
648648
this.removeTags(tagElm)
649649

650650
this.trigger("edit:updated", eventData)
651-
this.dropdown.hide()
651+
closeOnSelect && this.dropdown.hide()
652652

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

0 commit comments

Comments
 (0)