mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: wrap modal onShow inside next (#10651)
Before this commit, onShow code could be impacted by code happening after the onShow call. This should ensure this code works for example:
```
onShow() {
afterRender(() => {
someInput.focus();
})
}
```
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { next } from "@ember/runloop";
|
||||
import I18n from "I18n";
|
||||
import { dasherize } from "@ember/string";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
@@ -72,7 +73,7 @@ export default function (name, opts) {
|
||||
controller.set("model", model);
|
||||
}
|
||||
if (controller.onShow) {
|
||||
controller.onShow();
|
||||
next(() => controller.onShow());
|
||||
}
|
||||
controller.set("flashMessage", null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user