FIX: ensures focus is dropped before focus hyperlink input (#10653)

This commit is contained in:
Joffrey JAFFEUX
2020-09-11 16:45:51 +02:00
committed by GitHub
parent 0972994c7e
commit 10bdf36a24
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ export default Controller.extend(ModalFunctionality, {
.closest(".modal-inner-container") .closest(".modal-inner-container")
.addEventListener("mousedown", this.mouseDown); .addEventListener("mousedown", this.mouseDown);
document.querySelector("input.link-url").focus(); document.activeElement.blur();
}); });
}, },

View File

@ -1,4 +1,3 @@
import { next } from "@ember/runloop";
import I18n from "I18n"; import I18n from "I18n";
import { dasherize } from "@ember/string"; import { dasherize } from "@ember/string";
import { getOwner } from "discourse-common/lib/get-owner"; import { getOwner } from "discourse-common/lib/get-owner";
@ -73,7 +72,7 @@ export default function (name, opts) {
controller.set("model", model); controller.set("model", model);
} }
if (controller.onShow) { if (controller.onShow) {
next(() => controller.onShow()); controller.onShow();
} }
controller.set("flashMessage", null); controller.set("flashMessage", null);

View File

@ -6,6 +6,7 @@
placeholderKey="composer.link_url_placeholder" placeholderKey="composer.link_url_placeholder"
class="link-url" class="link-url"
key-up=(action "search") key-up=(action "search")
autofocus="autofocus"
}} }}
{{#if searchLoading}} {{#if searchLoading}}
{{loading-spinner}} {{loading-spinner}}