fix: Improve /menu (#14111)

如果选项隐藏了 (display:none),按上下方向键时就跳过
This commit is contained in:
Jeffrey Chen 2025-02-17 22:43:18 +08:00 committed by GitHub
parent d8415bcf42
commit 10a9ef1704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,7 @@
const isNormalItem = (currentHintElement: HTMLElement, className: string) => {
return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className);
return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className) ||
// https://github.com/siyuan-note/siyuan/issues/12518
currentHintElement.getBoundingClientRect().height === 0;
};
export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus", defaultElement?: Element) => {