hotkeys: Explicitly handle "home" and "end" key events.

This fixes a case with Google Chrome where the Home and End keys
caused scrolling in the message area, rather than being confined
to the compose box.
This commit is contained in:
Karl Stolley 2023-07-28 10:55:35 -05:00
parent 875d564f2d
commit d70761bd3f
No known key found for this signature in database
GPG Key ID: DB405205CD28EF88
1 changed files with 4 additions and 0 deletions

View File

@ -768,9 +768,13 @@ export function process_hotkey(e, hotkey) {
// don't return, as we still want it to be picked up by the code below
} else {
switch (event_name) {
// home and page up both move the cursor
case "home":
case "page_up":
$(":focus").caret(0).animate({scrollTop: 0}, "fast");
return true;
// end and page down both move the cursor
case "end":
case "page_down": {
// so that it always goes to the end of the text box.
const height = $(":focus")[0].scrollHeight;