mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
keydown_util: Extract all 'Enter' events to one place.
This is a prep commit to fix #22062.
This commit is contained in:
committed by
Tim Abbott
parent
aeb9a27d0e
commit
d4379f9528
@@ -5,6 +5,7 @@ import render_admin_default_streams_list from "../templates/settings/admin_defau
|
||||
import * as channel from "./channel";
|
||||
import * as hash_util from "./hash_util";
|
||||
import {$t_html} from "./i18n";
|
||||
import * as keydown_util from "./keydown_util";
|
||||
import * as ListWidget from "./list_widget";
|
||||
import * as loading from "./loading";
|
||||
import {page_params} from "./page_params";
|
||||
@@ -110,7 +111,7 @@ export function build_page() {
|
||||
update_default_streams_table();
|
||||
|
||||
$(".create_default_stream").on("keypress", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
if (keydown_util.is_enter_event(e)) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const $default_stream_input = $(".create_default_stream");
|
||||
|
||||
Reference in New Issue
Block a user