Skip to content

Commit

Permalink
clicking anywhere within an instance's dropdown should not hide it
Browse files Browse the repository at this point in the history
  • Loading branch information
yairEO committed May 8, 2024
1 parent 02f251c commit 2fcd364
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,10 @@ export default {
if (e.target != this.DOM.scope && !this.DOM.scope.contains(e.target)) {
this.toggleFocusClass(false)
this.state.hasFocus = false
this.dropdown.hide()

// do not hide the dropdown if a click was initiated within it and that dropdown belongs to this Tagify instance
if( e.target.closest('.tagify__dropdown') && e.target.closest('.tagify__dropdown').__tagify != this )
this.dropdown.hide()
}
},

Expand Down

0 comments on commit 2fcd364

Please sign in to comment.