Fix: update option when changing index
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user