Fix error with default selected option

This commit is contained in:
Talia 2025-01-22 15:46:10 +01:00
parent 5490237d88
commit 8499177fde
2 changed files with 2 additions and 2 deletions

View file

@ -3,6 +3,6 @@
"browser": "src/BetterSelect.js", "browser": "src/BetterSelect.js",
"type": "module", "type": "module",
"license": "MIT", "license": "MIT",
"version": "1.4.0", "version": "1.4.1",
"url": "https://darkwiiplayer.github.io/BetterSelect/" "url": "https://darkwiiplayer.github.io/BetterSelect/"
} }

View file

@ -377,7 +377,7 @@ export class BetterSelect extends HTMLElement {
set value(value) { set value(value) {
for (const option of this.options) { for (const option of this.options) {
if (option.value === String(value)) { if (option.value === String(value)) {
this.setOption(option) this.setValue(option.value, option.innerText)
return return
} }
} }