bugfix: remove selected class from other options
This commit is contained in:
parent
277b500f21
commit
d6c7417958
1 changed files with 6 additions and 1 deletions
|
@ -32,9 +32,14 @@ function handle_mutation_word_keyup(event) {
|
|||
const el_mutations = document.querySelector("#mutations");
|
||||
const el_step = event.target.closest(".mutation-step");
|
||||
const el_word = event.target.closest(".mutation-option");
|
||||
const els_word = el_step.querySelectorAll(".mutation-option");
|
||||
|
||||
// 2: Update UI - Change classes, Remove all subsequent mutation steps
|
||||
for(let i = 0; i < els_word.length; i++)
|
||||
els_word[i].classList.remove("selected");
|
||||
|
||||
// 2: Update UI - Add classes, Remove all subsequent mutation steps
|
||||
el_word.classList.add("selected");
|
||||
|
||||
while(el_step.nextElementSibling !== null)
|
||||
el_step.parentNode.removeChild(el_step.nextElementSibling);
|
||||
|
||||
|
|
Loading…
Reference in a new issue