Do not highlight first result or clear search input when holding control/meta key. #2910
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.
@harvesthq/chosen-developers to fix #2888, replaces #2900.
Building on @braddunbar’s #2900, this PR skips highlighting the first result as described in that PR and also does not reset the search input. This ensures we can do searchless multiple select when holding the control/meta key:
This also ensures we can do multiple select while searching using the control/meta key:
This is similar to the suggestion that @koenpunt mentioned in #2867 (comment):
This PR doesn’t exactly implement this behavior — it instead leaves the input when meta/control is pressed — but allows users to achieve the same thing.
I wasn’t able to implement a prototype version of the related test —
simulant
doesn’t appear to bubble events, so I can’t get the event handler to trigger correctly in prototype (either the event comes from the correct.active-result
item and doesn’t hit the event handler which is registered on.chosen-results
, or the event comes from the wrong item (.chosen-results
) and hits the event handler). I spent… too much time (3:04) working on trying to get a test working for prototype — but at least we’re covered with a jQuery test.