You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it might be useful to have an option so that highlightFirstItem won't highlight the first selected item, but will always highlight the first actual result instead.
The usecase I think it can be useful for is this:
When typing to search in the select2 field, the first result is often the most relevant one - and can easily be selected by pressing the enter key immediately after typing.
However, if I've already selected something before, and it happens to also be returned by the search, it will be highlighted, and then either the mouse of the arrow keys must be used to select the first result which is most often what i wanted after typing.
So an option to control this behavior could be useful.
I think it might be useful to have an option so that highlightFirstItem won't highlight the first selected item, but will always highlight the first actual result instead.
The usecase I think it can be useful for is this:
When typing to search in the select2 field, the first result is often the most relevant one - and can easily be selected by pressing the enter key immediately after typing.
However, if I've already selected something before, and it happens to also be returned by the search, it will be highlighted, and then either the mouse of the arrow keys must be used to select the first result which is most often what i wanted after typing.
So an option to control this behavior could be useful.
( Relevant code: https://github.com/select2/select2/blob/master/src/js/select2/results.js#L100 )
The text was updated successfully, but these errors were encountered: