mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
drafts: Fix hook for saving drafts.
Previously, the hook to save drafts when closing the compose box was a focusout on #compose-textarea. This mostly worked, and was essentially invisible to users (because the animation to notify you about saved drafts was in the close_compose_ui widget that is hidden), but you'd end up seeing the tooltip appear (in the wrong place) if you closed the compose box immediately after sending a message with Tab+Enter. The correct fix is for the drafts hook to be just before we start clearing compose box state, inside hide_box. This was difficult to catch in a development environment, since one doesn't use that flow with "Enter sends" enabled.
This commit is contained in:
@@ -174,10 +174,6 @@ test("initialize", (override) => {
|
||||
};
|
||||
|
||||
drafts.initialize();
|
||||
|
||||
const message_content = $("#compose-textarea");
|
||||
assert.equal(message_content.get_on_handler("focusout"), drafts.update_draft);
|
||||
message_content.trigger("focusout");
|
||||
});
|
||||
|
||||
test("remove_old_drafts", () => {
|
||||
|
Reference in New Issue
Block a user