Skip to content

Commit eee6be6

Browse files
authored
Merge pull request #1260 from zoglo/fix/close-dropdown-search-disabled
Fix `tab` => direction keys handling with disabled search
2 parents f1364cc + 7167792 commit eee6be6

File tree

10 files changed

+41
-12
lines changed

10 files changed

+41
-12
lines changed

public/assets/scripts/choices.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
(function (global, factory) {
44
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -4897,6 +4897,10 @@
48974897
else if (target === this.containerOuter.element) {
48984898
// Remove the focus state when the past outerContainer was the target
48994899
containerOuter.removeFocusState();
4900+
// Also close the dropdown if search is disabled
4901+
if (!this._canSearch) {
4902+
this.hideDropdown(true);
4903+
}
49004904
}
49014905
}
49024906
else {

public/assets/scripts/choices.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/scripts/choices.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
/******************************************************************************
44
Copyright (c) Microsoft Corporation.
@@ -4891,6 +4891,10 @@ var Choices = /** @class */ (function () {
48914891
else if (target === this.containerOuter.element) {
48924892
// Remove the focus state when the past outerContainer was the target
48934893
containerOuter.removeFocusState();
4894+
// Also close the dropdown if search is disabled
4895+
if (!this._canSearch) {
4896+
this.hideDropdown(true);
4897+
}
48944898
}
48954899
}
48964900
else {

public/assets/scripts/choices.search-basic.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
(function (global, factory) {
44
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -4415,6 +4415,10 @@
44154415
else if (target === this.containerOuter.element) {
44164416
// Remove the focus state when the past outerContainer was the target
44174417
containerOuter.removeFocusState();
4418+
// Also close the dropdown if search is disabled
4419+
if (!this._canSearch) {
4420+
this.hideDropdown(true);
4421+
}
44184422
}
44194423
}
44204424
else {

public/assets/scripts/choices.search-basic.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/scripts/choices.search-basic.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
/******************************************************************************
44
Copyright (c) Microsoft Corporation.
@@ -4409,6 +4409,10 @@ var Choices = /** @class */ (function () {
44094409
else if (target === this.containerOuter.element) {
44104410
// Remove the focus state when the past outerContainer was the target
44114411
containerOuter.removeFocusState();
4412+
// Also close the dropdown if search is disabled
4413+
if (!this._canSearch) {
4414+
this.hideDropdown(true);
4415+
}
44124416
}
44134417
}
44144418
else {

public/assets/scripts/choices.search-prefix.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
(function (global, factory) {
44
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -3257,6 +3257,10 @@
32573257
else if (target === this.containerOuter.element) {
32583258
// Remove the focus state when the past outerContainer was the target
32593259
containerOuter.removeFocusState();
3260+
// Also close the dropdown if search is disabled
3261+
if (!this._canSearch) {
3262+
this.hideDropdown(true);
3263+
}
32603264
}
32613265
}
32623266
else {

public/assets/scripts/choices.search-prefix.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/scripts/choices.search-prefix.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
1+
/*! choices.js v11.0.3 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
22

33
/******************************************************************************
44
Copyright (c) Microsoft Corporation.
@@ -3251,6 +3251,10 @@ var Choices = /** @class */ (function () {
32513251
else if (target === this.containerOuter.element) {
32523252
// Remove the focus state when the past outerContainer was the target
32533253
containerOuter.removeFocusState();
3254+
// Also close the dropdown if search is disabled
3255+
if (!this._canSearch) {
3256+
this.hideDropdown(true);
3257+
}
32543258
}
32553259
}
32563260
else {

src/scripts/choices.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,11 @@ class Choices {
19791979
} else if (target === this.containerOuter.element) {
19801980
// Remove the focus state when the past outerContainer was the target
19811981
containerOuter.removeFocusState();
1982+
1983+
// Also close the dropdown if search is disabled
1984+
if (!this._canSearch) {
1985+
this.hideDropdown(true);
1986+
}
19821987
}
19831988
} else {
19841989
// On IE11, clicking the scollbar blurs our input and thus

0 commit comments

Comments
 (0)