Skip to content

Commit

Permalink
Merge pull request #439 from ONLYOFFICE/bugfix/fix-hotkeys-scrolling
Browse files Browse the repository at this point in the history
Web: Hotkeys: fixed scroll focus
  • Loading branch information
AlexeySafronov authored May 28, 2024
2 parents 015956d + 61b00dd commit d9b1ec3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/client/src/store/AccountsHotkeysStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/store/HotkeyStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d9b1ec3

Please sign in to comment.