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:
Ganesh Pawar 2021-04-01 11:03:40 +05:30 committed by Tim Abbott
parent e7e2340eda
commit 5262ca7621
1 changed files with 6 additions and 1 deletions

View File

@ -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();