fix firstUpdated callback in case where parent is also newly created

This commit is contained in:
Niels Lyngsø
2024-11-07 15:46:08 +01:00
parent a26d49e5b7
commit 0d0f22a1f9

View File

@@ -162,9 +162,11 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
this._setParent(null);
}
}
if (this.parent && this.parent.match !== null && this.match === null) {
if (this.parent) {
requestAnimationFrame(() => {
this.render();
if (this.parent && this.parent.match !== null && this.match === null) {
this.render();
}
});
}
}