Add option to not close select on tab keypress #1218
+34
−3
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.
I would like to add an optional property to the
power-select
component to allow the dropdown to stay open on a "Tab" keypress. You currently can pass theonkeydown
method to the component and do some customization that way. You can then returnfalse
in this method to prevent the default closing behavior from occurring. But my use case involves tabbing through / focusing content within the dropdown portion of the select. If I were to return false inonkeydown
, the default browser focus behavior would also be prevented. Creating this property allows thepower-select's
default tab behavior to be avoided, while allowing the browser's default tab behavior to be preserved.