navigating through faq with arrow, tab and shift tab implemented

This commit is contained in:
j264415 2024-02-29 10:39:31 +00:00
parent 798c06d28a
commit 9e4a53fb17
1 changed files with 7 additions and 4 deletions

View File

@ -406,12 +406,15 @@ ${navigator.userAgent}
} else {
prevElement.previousElementSibling.previousElementSibling.focus();
}
} else if(ev.key === "Tab"){
} else if(ev.key === "Tab" && !ev.shiftKey){
ev.preventDefault();
ev.stopPropagation();
currentElement.parentElement.parentElement.parentElement.nextElementSibling.firstElementChild.focus();
}
} else if(ev.shiftKey && ev.key === "Tab"){
currentElement.parentElement.parentElement.previousElementSibling.firstElementChild.firstElementChild.focus();
console.log("shift tab", currentElement.parentElement.parentElement.previousElementSibling.firstElementChild.firstElementChild);
}
}
@ -452,12 +455,12 @@ ${navigator.userAgent}
downPanel.nextElementSibling.firstElementChild.querySelector("[class='btn btn-primary']").focus();
console.log("Arrowdown focus 2", downPanel.nextElementSibling.firstElementChild.querySelector("[class='btn btn-primary']"));
}
} else if(ev.key === "Tab"){
} else if(ev.key === "Tab" && !ev.shiftKey){
ev.preventDefault();
ev.stopPropagation();
tab.parentElement.parentElement.parentElement.nextElementSibling.firstElementChild.focus();
}
}
}