This commit is contained in:
Vanessa 2023-11-15 18:40:01 +08:00
parent dc7f763054
commit 5cce04da49
6 changed files with 47 additions and 32 deletions

View file

@ -22,7 +22,8 @@ export class Menus {
return;
}
let target = event.target as HTMLElement;
while (target && !target.parentElement.isEqualNode(document.querySelector("body"))) {
while (target && target.parentElement // ⌃⇥ 后点击会为空
&& !target.parentElement.isEqualNode(document.querySelector("body"))) {
event.preventDefault();
const dataType = target.getAttribute("data-type");
if (dataType === "tab-header") {