message_edit: Fix `tab + enter` broken for saving.

There is no `.message_edit_content` in `focus` when user does
`tab + enter` to save the message. We use the existing text
content edit object get identify the row being edited which is
more robust and efficient.
This commit is contained in:
Aman Agrawal 2024-09-21 01:12:24 +00:00 committed by Tim Abbott
parent 7302499485
commit 33a677f317
1 changed files with 1 additions and 1 deletions

View File

@ -381,7 +381,7 @@ function handle_message_edit_enter(
): void {
// Pressing Enter to save edits is coupled with Enter to send
if (composebox_typeahead.should_enter_send(e)) {
const $row = $(".message_edit_content:focus").closest(".message_row");
const $row = $message_edit_content.closest(".message_row");
const $message_edit_save_button = $row.find(".message_edit_save");
if ($message_edit_save_button.prop("disabled")) {
// In cases when the save button is disabled