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 tab => direction keys handling with disabled search #1260

Merged
merged 1 commit into from
Feb 3, 2025
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: 5 additions & 1 deletion public/assets/scripts/choices.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -4897,6 +4897,10 @@
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions public/assets/scripts/choices.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion public/assets/scripts/choices.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -4891,6 +4891,10 @@ var Choices = /** @class */ (function () {
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
6 changes: 5 additions & 1 deletion public/assets/scripts/choices.search-basic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -4415,6 +4415,10 @@
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions public/assets/scripts/choices.search-basic.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion public/assets/scripts/choices.search-basic.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -4409,6 +4409,10 @@ var Choices = /** @class */ (function () {
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
6 changes: 5 additions & 1 deletion public/assets/scripts/choices.search-prefix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -3257,6 +3257,10 @@
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions public/assets/scripts/choices.search-prefix.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion public/assets/scripts/choices.search-prefix.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -3251,6 +3251,10 @@ var Choices = /** @class */ (function () {
else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();
// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
}
else {
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,11 @@ class Choices {
} else if (target === this.containerOuter.element) {
// Remove the focus state when the past outerContainer was the target
containerOuter.removeFocusState();

// Also close the dropdown if search is disabled
if (!this._canSearch) {
this.hideDropdown(true);
}
}
} else {
// On IE11, clicking the scollbar blurs our input and thus
Expand Down
Loading