This commit is contained in:
parent
ceb1523071
commit
c7a23dfa00
1 changed files with 7 additions and 0 deletions
|
@ -396,6 +396,13 @@ export const globalShortcut = () => {
|
|||
const sideElement = currentLiElement.parentElement.previousElementSibling || currentLiElement.parentElement.nextElementSibling;
|
||||
(sideElement.querySelector(`[data-index="${currentLiElement.getAttribute("data-index")}"]`) || sideElement.lastElementChild).classList.add("b3-list-item--focus");
|
||||
}
|
||||
const currentRect = switchDialog.element.querySelector(".b3-list-item--focus").getBoundingClientRect();
|
||||
const currentParentRect = currentLiElement.parentElement.getBoundingClientRect();
|
||||
if (currentRect.top < currentParentRect.top) {
|
||||
currentLiElement.scrollIntoView(true);
|
||||
} else if (currentRect.bottom > currentParentRect.bottom) {
|
||||
currentLiElement.scrollIntoView(false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue