From d04273eb198e63bef7009ab1cd63eda728315f8a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 8 Dec 2022 15:41:27 +0800 Subject: [PATCH] :bug: https://ld246.com/article/1670477204246 --- app/src/util/globalShortcut.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 8036d70ff..451f90c49 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -1226,8 +1226,14 @@ const panelTreeKeydown = (event: KeyboardEvent) => { while (nextElement) { if (nextElement.nextElementSibling) { if (nextElement.nextElementSibling.tagName === "UL") { - nextElement = nextElement.nextElementSibling.firstElementChild; - } else if (nextElement.nextElementSibling.classList.contains("protyle")) { + if (nextElement.nextElementSibling.classList.contains("fn__none")) { // 遇到折叠内容 + if (nextElement.nextElementSibling.nextElementSibling) { + nextElement = nextElement.nextElementSibling.nextElementSibling + } + } else { + nextElement = nextElement.nextElementSibling.firstElementChild; + } + } else if (nextElement.nextElementSibling.classList.contains("protyle")) { // backlink if (nextElement.nextElementSibling.nextElementSibling) { nextElement = nextElement.nextElementSibling.nextElementSibling; } @@ -1265,6 +1271,10 @@ const panelTreeKeydown = (event: KeyboardEvent) => { if (previousElement.previousElementSibling.previousElementSibling) { previousElement = previousElement.previousElementSibling.previousElementSibling; } + } else if (previousElement.previousElementSibling.tagName === "UL" && previousElement.previousElementSibling.classList.contains("fn__none")) { // 遇到折叠内容 + if (previousElement.previousElementSibling.previousElementSibling) { + previousElement = previousElement.previousElementSibling.previousElementSibling; + } } else { const liElements = previousElement.previousElementSibling.querySelectorAll(".b3-list-item"); previousElement = liElements[liElements.length - 1];