Merge pull request #439 from ONLYOFFICE/bugfix/fix-hotkeys-scrolling

Web: Hotkeys: fixed scroll focus
This commit is contained in:
Alexey Safronov 2024-05-28 11:59:38 +04:00 committed by GitHub
commit d9b1ec35e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -255,7 +255,11 @@ class AccountsHotkeysStore {
const scroll = document.getElementsByClassName(
"section-scroll",
) as HTMLCollectionOf<HTMLElement>;
if (scroll && scroll[0]) scroll[0].focus();
if (scroll && scroll[0]) {
const scrollElem = scroll[0]?.firstChild as HTMLElement;
scrollElem?.focus();
}
}
if (!this.hotkeyCaret && selection.length) {

View File

@ -135,7 +135,7 @@ class HotkeyStore {
if (!hotkeyCaret) {
const scroll = document.getElementsByClassName("section-scroll");
scroll && scroll[0] && scroll[0].focus();
scroll && scroll[0] && scroll[0]?.firstChild.focus();
}
if (!hotkeyCaret && selection.length) {