mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-03 14:23:12 +02:00
feat: added trim to getting the choices from options
This commit is contained in:
parent
5dbea2825a
commit
a6efdf59b0
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -61,7 +61,7 @@
|
|||
}
|
||||
],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"stylelint.validate": [
|
||||
"css",
|
||||
|
|
|
@ -286,7 +286,7 @@ class Choices implements Choices {
|
|||
(this.passedElement as WrappedSelect).options.forEach((option) => {
|
||||
this._presetChoices.push({
|
||||
value: option.value,
|
||||
label: option.innerHTML,
|
||||
label: option.innerHTML.trim(),
|
||||
selected: !!option.selected,
|
||||
disabled: option.disabled || option.parentNode.disabled,
|
||||
placeholder:
|
||||
|
@ -319,7 +319,7 @@ class Choices implements Choices {
|
|||
if (this.passedElement.isActive) {
|
||||
if (!this.config.silent) {
|
||||
console.warn(
|
||||
'Trying to initialise Choices on element already initialised',
|
||||
'Trying to initialize Choices on element already initialized',
|
||||
{ element },
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue