Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shift key handling when navigating with tab #1245

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/scripts/choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1606,15 +1606,15 @@ class Choices {
event.key === 'Unidentified';

/*
We do not show the dropdown if the keycode was tab or esc
as these one are used to focusOut of e.g. select choices.
We do not show the dropdown if focusing out with esc or navigating through input fields.
An activated search can still be opened with any other key.
*/
if (
!this._isTextElement &&
!hasActiveDropdown &&
keyCode !== KeyCodeMap.ESC_KEY &&
keyCode !== KeyCodeMap.TAB_KEY
keyCode !== KeyCodeMap.TAB_KEY &&
keyCode !== KeyCodeMap.SHIFT_KEY
) {
this.showDropdown();

Expand Down
1 change: 1 addition & 0 deletions src/scripts/interfaces/keycode-map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const KeyCodeMap = {
TAB_KEY: 9,
SHIFT_KEY: 16,
BACK_KEY: 46,
DELETE_KEY: 8,
ENTER_KEY: 13,
Expand Down
Loading