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",
"type": "module",
"license": "MIT",
"version": "1.4.0",
"version": "1.4.1",
"url": "https://darkwiiplayer.github.io/BetterSelect/"
}

View file

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