Skip to content

Commit

Permalink
fix: PageUp/Down only working for messages list
Browse files Browse the repository at this point in the history
Some examples where this commit makes Page Up / Page Down work:
- chat list
- gallery
- settings
- contact lists
- accoutns list
- chat audit log
  • Loading branch information
WofWca committed Oct 26, 2024
1 parent d494cd5 commit 5084b9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- avoid showing horizontal scrollbars in chat list #4253
- style: fix VCard color being too bright in dark theme #4255
- remove unnecessary horizontal scrollbar in "View Group" dialog #4254
- "Page Up" / "Page Down" not working on scrollable elements except for messages list #4268

<a id="1_47_0"></a>

Expand Down
16 changes: 12 additions & 4 deletions packages/frontend/src/keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ export function keyDownEvent2Action(
} else if (ev.code === 'F5') {
return KeybindAction.Debug_MaybeNetwork
} else if (ev.code === 'PageUp') {
return KeybindAction.MessageList_PageUp
if ((ev.target as HTMLElement)?.id === 'composer-textarea') {
return KeybindAction.MessageList_PageUp
}
} else if (ev.code === 'PageDown') {
return KeybindAction.MessageList_PageDown
if ((ev.target as HTMLElement)?.id === 'composer-textarea') {
return KeybindAction.MessageList_PageDown
}
} else if ((ev.metaKey || ev.ctrlKey) && ev.code === 'Slash') {
return KeybindAction.KeybindingCheatSheet_Open
}
Expand All @@ -133,9 +137,13 @@ export function keyDownEvent2Action(
} else if (ev.ctrlKey && ev.code === 'PageUp') {
return KeybindAction.ChatList_SelectPreviousChat
} else if (ev.code === 'PageUp') {
return KeybindAction.MessageList_PageUp
if ((ev.target as HTMLElement)?.id === 'composer-textarea') {
return KeybindAction.MessageList_PageUp
}
} else if (ev.code === 'PageDown') {
return KeybindAction.MessageList_PageDown
if ((ev.target as HTMLElement)?.id === 'composer-textarea') {
return KeybindAction.MessageList_PageDown
}
} else if (ev.altKey && ev.code === 'ArrowDown') {
return KeybindAction.ChatList_SelectNextChat
} else if (ev.altKey && ev.code === 'ArrowUp') {
Expand Down

0 comments on commit 5084b9f

Please sign in to comment.