mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
hotkey: Map numpad navigation keys to close compose when empty.
This maps pageup/pagedown/home/end to close compose when used in empty compose box, matching the existing behavior for the Up/Down arrow keys. Currently, these keys do nothing when used in an empty compose box. Typically, a user intends to navigate when pressing these keys (and with empty compose, they can't be expecting to navigate within the compose box), so it makes sense to map them to navigate the message feed just to save users from needing to hit `Esc` in these contexts. Fixes #17917
This commit is contained in:
@@ -651,7 +651,12 @@ export function process_hotkey(e, hotkey) {
|
||||
}
|
||||
|
||||
if (
|
||||
(event_name === "up_arrow" || event_name === "down_arrow") &&
|
||||
(event_name === "up_arrow" ||
|
||||
event_name === "down_arrow" ||
|
||||
event_name === "page_up" ||
|
||||
event_name === "page_down" ||
|
||||
event_name === "home" ||
|
||||
event_name === "end") &&
|
||||
compose_state.focus_in_empty_compose()
|
||||
) {
|
||||
compose_actions.cancel();
|
||||
|
||||
Reference in New Issue
Block a user