mirror of https://github.com/zulip/zulip.git
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:
parent
27b04cb7ed
commit
1212635151
|
@ -35,6 +35,8 @@ export function convert_enter_to_click(e) {
|
||||||
const key = e.which;
|
const key = e.which;
|
||||||
if (key === 13) {
|
if (key === 13) {
|
||||||
// Enter
|
// Enter
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
$(e.currentTarget).trigger("click");
|
$(e.currentTarget).trigger("click");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue