choices.js
Advanced tools
Comparing version 7.1.0 to 7.1.1
{ | ||
"name": "choices.js", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "A vanilla JS customisable text input/select box plugin", | ||
@@ -5,0 +5,0 @@ "main": "./public/assets/scripts/choices.min.js", |
@@ -83,5 +83,9 @@ import Fuse from 'fuse.js'; | ||
if (!passedElement) { | ||
return console.error( | ||
'Could not find passed element or passed element was of an invalid type', | ||
); | ||
if (!this.config.silent) { | ||
console.error( | ||
'Could not find passed element or passed element was of an invalid type', | ||
); | ||
} | ||
return; | ||
} | ||
@@ -113,12 +117,2 @@ | ||
if ( | ||
this.config.shouldSortItems === true && | ||
this._isSelectOneElement && | ||
!this.config.silent | ||
) { | ||
console.warn( | ||
"shouldSortElements: Type of passed element is 'select-one', falling back to false.", | ||
); | ||
} | ||
this.initialised = false; | ||
@@ -169,7 +163,15 @@ | ||
// If element has already been initialised with Choices, fail silently | ||
if (this.passedElement.element.getAttribute('data-choice') === 'active') { | ||
console.warn( | ||
'Trying to initialise Choices on element already initialised', | ||
); | ||
if (!this.config.silent) { | ||
if (this.config.shouldSortItems === true && this._isSelectOneElement) { | ||
console.warn( | ||
"shouldSortElements: Type of passed element is 'select-one', falling back to false.", | ||
); | ||
} | ||
// If element has already been initialised with Choices, fail silently | ||
if (this.passedElement.element.getAttribute('data-choice') === 'active') { | ||
console.warn( | ||
'Trying to initialise Choices on element already initialised', | ||
); | ||
} | ||
} | ||
@@ -176,0 +178,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
508981
10670