Skip to content

Commit

Permalink
Fix searchEnable flag was not respected for select-multiple Choic…
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Jul 31, 2024
1 parent 0195386 commit 9093d5a
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
* Fix `addItemFilter` would allow empty strings as input to be added for items.
* Fix various issues with double escaping when displaying items/choices depending on allowHTML mode.
* Fix `aria-label` for placeholders was set to the string `null`
* Fix `searchEnable` flag was not respected for `select-multiple` [#1042](https://github.com/Choices-js/Choices/issues/1042)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ Pass an array of objects:

**Type:** `Boolean` **Default:** `true`

**Input types affected:** `select-one`
**Input types affected:** `select-one`, `select-multiple`

**Usage:** Whether a search area should be shown. **Note:** Multiple select boxes will _always_ show search areas.
**Usage:** Whether a search area should be shown.

### searchChoices

Expand Down
1 change: 0 additions & 1 deletion public/assets/scripts/choices.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ var Choices = /** @class */function () {
this._isSelectOneElement = this._elementType === constants_1.SELECT_ONE_TYPE;
this._isSelectMultipleElement = this._elementType === constants_1.SELECT_MULTIPLE_TYPE;
this._isSelectElement = this._isSelectOneElement || this._isSelectMultipleElement;
this.config.searchEnabled = this._isSelectMultipleElement || this.config.searchEnabled;
if (!['auto', 'always'].includes("".concat(this.config.renderSelectedChoices))) {
this.config.renderSelectedChoices = 'auto';
}
Expand Down
2 changes: 1 addition & 1 deletion public/assets/scripts/choices.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/types/src/scripts/choices.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions public/types/src/scripts/interfaces/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ export interface Options {
/**
* Whether a search area should be shown.
*
* @note Multiple select boxes will always show search areas.
*
* **Input types affected:** select-one
* **Input types affected:** select-one, select-multiple
*
* @default true
*/
Expand Down
2 changes: 1 addition & 1 deletion public/types/src/scripts/interfaces/options.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9093d5a

Please sign in to comment.