Skip to content

Commit

Permalink
message_edit: Fix tab + enter broken for saving.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
amanagr authored and timabbott committed Sep 21, 2024
1 parent 7302499 commit 33a677f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/message_edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33a677f

Please sign in to comment.