Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PageUp/Down only working for messages list #4269

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- fix deleting messages with broken video attachment from gallery #4283
- accessibility: wrong positioning of some context menus and popups when activating them with keyboard #4246
- improve keyboard and screen-reader accessibility #4210
- "Page Up" / "Page Down" not working on scrollable elements except for messages list #4269

<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
Loading