Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes a
The following changes were made
MultipleSelection: the delegated click handler for.select2-selection__choice__removenow callsevt.stopPropagation(), so removing a choice doesn't bubble up to the selection's toggle handler and open the dropdown. Thekeydownhandler for the same selector already does this.AllowClear._handleClear: removed the trailingthis.trigger('toggle', {}), so clearing a selection no longer opens the dropdown (and no longer triggers an unwanted ajax query viaopen(), see Ajax is requested when clear button is pressed and dropdown has been kept closed #6116).In both cases the user is just removing a selection, but the dropdown opens as a side effect. This has been reported a few times over the years (#3632, #4281, #3320) and is usually worked around with the
select2:unselecting+select2:openingpreventDefault trick.No new options or API changes. Test suite passes (1088 tests, 0 failed, all four jQuery matrices). Note this does change behavior for anyone relying on the clear button also opening the dropdown.
Fixes #6389, fixes #6116