Fix: update option when changing index

This commit is contained in:
Jorge Manrubia
2025-06-05 17:03:21 +02:00
parent d78a61b8fc
commit 35b8b6f470
@@ -18,6 +18,7 @@ export default class extends Controller {
set #index(index) {
this.fieldTarget.style.setProperty("--knob-index", `${index}`);
this.sliderTarget.value = index
this.#optionForIndex(index).checked = true
}
get #selectedOption() {
@@ -26,10 +27,6 @@ export default class extends Controller {
})
}
set #value(index) {
this.#optionForIndex(index).checked = true
}
#optionForIndex(index) {
return this.optionTargets.find(option => {
return option.dataset.index === index;