Ensure controller is still present (#19408)
* check controller is still present * Update src/Umbraco.Web.UI.Client/src/libs/controller-api/controller-host.mixin.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -60,8 +60,8 @@ export const UmbControllerHostMixin = <T extends ClassConstructor>(superClass: T
|
||||
if (this.#attached) {
|
||||
// If a controller is created on a already attached element, then it will be added directly. This might not be optimal. As the controller it self has not finished its constructor method jet. therefor i postpone the call: [NL]
|
||||
Promise.resolve().then(() => {
|
||||
// Extra check to see if we are still attached at this point:
|
||||
if (this.#attached) {
|
||||
// Extra check to see if we are still attached and still added at this point:
|
||||
if (this.#attached && this.#controllers.includes(ctrl)) {
|
||||
ctrl.hostConnected();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user