Have value setter toString its value before option lookup

This commit is contained in:
Talia 2025-01-15 16:44:50 +01:00
parent c2384c540f
commit 917b862786
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.2.0",
"version": "1.2.1",
"url": "https://darkwiiplayer.github.io/BetterSelect/"
}

View file

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