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

View file

@ -406,11 +406,14 @@ ${navigator.userAgent}
} else { } else {
prevElement.previousElementSibling.previousElementSibling.focus(); prevElement.previousElementSibling.previousElementSibling.focus();
} }
} else if(ev.key === "Tab"){ } else if(ev.key === "Tab" && !ev.shiftKey){
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
currentElement.parentElement.parentElement.parentElement.nextElementSibling.firstElementChild.focus(); 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,7 +455,7 @@ ${navigator.userAgent}
downPanel.nextElementSibling.firstElementChild.querySelector("[class='btn btn-primary']").focus(); downPanel.nextElementSibling.firstElementChild.querySelector("[class='btn btn-primary']").focus();
console.log("Arrowdown focus 2", downPanel.nextElementSibling.firstElementChild.querySelector("[class='btn btn-primary']")); 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.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
tab.parentElement.parentElement.parentElement.nextElementSibling.firstElementChild.focus(); tab.parentElement.parentElement.parentElement.nextElementSibling.firstElementChild.focus();