Merge pull request #1021 from Choices-js/fix-param

Fix type for parameter on setChoiceByValue
This commit is contained in:
Matt Triff 2022-03-13 17:30:36 -04:00 committed by GitHub
commit 20d3f5cd55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/*! choices.js v10.0.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v10.1.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();

View File

@ -66,7 +66,7 @@ declare class Choices implements Choices {
hideDropdown(preventInputBlur?: boolean): this;
getValue(valueOnly?: boolean): string[] | Item[] | Item | string;
setValue(items: string[] | Item[]): this;
setChoiceByValue(value: string): this;
setChoiceByValue(value: string | string[]): this;
/**
* Set choices of select input via an array of objects (or function that returns array of object or promise of it),
* a value field name and a label field name.

File diff suppressed because one or more lines are too long

View File

@ -553,7 +553,7 @@ class Choices implements Choices {
return this;
}
setChoiceByValue(value: string): this {
setChoiceByValue(value: string | string[]): this {
if (!this.initialised || this._isTextElement) {
return this;
}