composebox_typeahead: Trigger foucs to send button only after keyup event.

As explained in the commit 3a35a0b72c:
`nextFocus` is set on a keydown event to indicate where
we should focus on keyup. We can't focus at the time of
keydown because we need to wait for typeahead. And we
can't compute where to focus at the time of keyup because
only the keydown has reliable information about whether it
was a Tab or a Shift+Tab.

Though the previous configuration didn't show any bug but we should
follow the same logic here also.
This commit is contained in:
akshatdalton
2021-07-27 22:37:37 +00:00
committed by Tim Abbott
parent 30435d7943
commit 3531463ac9

View File

@@ -216,8 +216,7 @@ function handle_keydown(e) {
// which does not make <button>s tab-accessible by default
// (even if we were to set tabindex=0).
if (!should_enter_send(e)) {
$("#compose-send-button").trigger("focus");
e.preventDefault();
nextFocus = $("#compose-send-button");
}
} else {
// Enter