Merge pull request #75 from HendrikRauh/68-slider-value-on-first-load

fix #68 wrong slider value on first load
This commit is contained in:
Hendrik Rauh 2025-04-15 21:44:55 +02:00 committed by GitHub
commit fd4ab30da9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,6 +33,11 @@ export function writeDataToInput(data) {
} else {
element.value = value;
}
if (element.type === "range") {
// update text next to the slider by sending an event
element.dispatchEvent(new Event("input", { bubbles: true }));
}
}
// send "change" event
form.dispatchEvent(new Event("change", { bubbles: true }));