Support selecting with tab on searchable multiselects #1432
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.
Refresh of #654 which had merge conflicts with the latest master.
Includes fresh run of
npm run bundle
Versioning
Confirmed that fix aligns with the behavior in the current state of the unreleased v3 (https://github.com/shentao/vue-multiselect/tree/v3)
If bug fixes/ maintenance aren't desired for the currently released v2 and all efforts are focused on releasing v3, it's okay to close this PR. Figured I'd submit one anyway as I have done the work already for my company.
Demo
Before, if a user types some text and presses tab, it will clear the text and move to the next focusable item:
After: the inputted text will become a new selected option:
Before, if a user keys up/down and presses tab, a selection will not occur:
After: navigating the dropdown, then pressing tab, will select the currently focused option
As before, deselecting will not be triggered by tab
Note: "keyboard buffer" links were temporary code for this demo and aren't in final changes
Code changes
select()
:Possible impact of change on other behavior
pointerDirty
works as expected inselect()
.pointerDirty
only affects behavior if the key pressed was "tab"