pat-select2 native input/change/blur events#1598
Merged
Merged
Conversation
When a selection change was done in pat-select2, the Select2 library was only firing a jQuery change event which was never caught by native JavaScript event handlers. This is now fixed - on a Select2 change event a native JavaScript input event is fired. The input event is used as it is the better choice. The native change event has some limitations and is historically not fired on each value change. This aligns the behavior to pat-auto-suggest from @patternslib/patternslib.
When Select2 looses focus a jQuery blur event is thrown. This is not catched by native JavaScript event handler. This is now fixed - a Select2 blur event also throws a native blur event on the original input or select element. This aligns the behavior to pat-auto-suggest from @patternslib/patternslib.
8571ffe to
3290a6f
Compare
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.
Align with @patternslib/patternslib pat-auto-suggest and throw native input, change and blur events on the original input element when Select2 throws it's jQuery equivalents.
This allows the upcoming @patternslib/patternslib pat-bind pattern to get active when a select2 change has happened: Patternslib/Patterns#1288
This is also some cleanup before pat-select2 gets replaced by some other, leaner, non-jQuery based select enhancement library.
If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.
Closes #