Skip to content

Commit

Permalink
Merge remote-tracking branch 'main' into fix-tab-direction-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Dec 22, 2024
2 parents c63d530 + 00225b6 commit bb2e36b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1611,15 +1611,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

0 comments on commit bb2e36b

Please sign in to comment.