mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
ui_util: Stop propagation enter keypress when it is already handled.
This is good to do in general for these type of event handlers and this also fixes a bug where pressing on reply button in the recent topics will open compose with a new line since browser assumed enter was pressed on compose_textarea since process_enter_key returned false.
This commit is contained in:
@@ -35,6 +35,8 @@ export function convert_enter_to_click(e) {
|
||||
const key = e.which;
|
||||
if (key === 13) {
|
||||
// Enter
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$(e.currentTarget).trigger("click");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user