mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-25 01:36:09 +01:00
This commit is contained in:
parent
b0fecae66e
commit
d08ffd8f41
2 changed files with 8 additions and 11 deletions
|
|
@ -2,8 +2,13 @@ const isNormalItem = (currentHintElement: HTMLElement, className: string) => {
|
|||
return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className);
|
||||
};
|
||||
|
||||
export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus") => {
|
||||
export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus", defaultElement?: Element) => {
|
||||
let currentHintElement: HTMLElement = listElement.querySelector("." + classActiveName);
|
||||
if (!currentHintElement && defaultElement) {
|
||||
defaultElement.classList.add(classActiveName);
|
||||
defaultElement.scrollIntoView(true);
|
||||
return;
|
||||
}
|
||||
if (!currentHintElement) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue