mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-08 08:36:34 +02:00
Check value is type string before calling trim()
This commit is contained in:
parent
1b8621b54e
commit
110796e25f
|
@ -1111,7 +1111,7 @@ class Choices {
|
|||
}
|
||||
|
||||
if (this.passedElement.type === 'text' && this.config.addItems && canAddItem) {
|
||||
const isUnique = !activeItems.some((item) => item.value === value.trim());
|
||||
const isUnique = !activeItems.some((item) => item.value === isType('String', value) ? value.trim() : value);
|
||||
|
||||
// If a user has supplied a regular expression filter
|
||||
if (this.config.regexFilter) {
|
||||
|
|
Loading…
Reference in a new issue