mirror of https://github.com/zulip/zulip.git
edit_linkifier: Fix multiple modals opening.
Earlier the `edit` button was still in focus even after opening the modal. This caused the modal to open multiple times when the user pressed the enter key. This commit fixes that issue by placing the carat at the end of the first input field when the modal is opened.
This commit is contained in:
parent
37725e4e9f
commit
87ff793b5a
|
@ -16,6 +16,7 @@ import * as scroll_util from "./scroll_util";
|
|||
import * as settings_ui from "./settings_ui";
|
||||
import {current_user, realm} from "./state_data";
|
||||
import * as ui_report from "./ui_report";
|
||||
import * as ui_util from "./ui_util";
|
||||
|
||||
type RealmLinkifiers = typeof realm.realm_linkifiers;
|
||||
|
||||
|
@ -106,6 +107,9 @@ function open_linkifier_edit_form(linkifier_id: number): void {
|
|||
on_click() {
|
||||
submit_linkifier_form(dialog_widget_id);
|
||||
},
|
||||
on_shown() {
|
||||
ui_util.place_caret_at_end($("#edit-linkifier-pattern")[0]!);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue