Skip to content

Commit d70aa14

Browse files
committed
#7076 updateVdom() preventing all attempts before reaching isConstructed. container.Base: createItems() => preventing update() if not constructed.
1 parent 6dbafdf commit d70aa14

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/container/Base.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class Container extends Component {
441441

442442
// We need to add items into the vdom
443443
me.updateDepth = -1;
444-
me.update();
444+
me.isConstructed && me.update();
445445

446446
me.fire('itemsCreated', {id: me.id, items})
447447
}

src/mixin/VdomLifecycle.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,18 @@ class VdomLifecycle extends Base {
599599
* @protected
600600
*/
601601
updateVdom(resolve, reject) {
602+
if (!this.isConstructed) {
603+
resolve?.();
604+
return
605+
}
606+
602607
if (Neo.config.unitTestMode && !Neo.config.allowVdomUpdatesInTests) {
603608
reject?.();
604609
return
605610
}
606611

607-
let me = this,
608-
{app, mounted, parentId, vnode} = me;
612+
let me = this,
613+
{mounted, parentId, vnode} = me;
609614

610615
if (me.isVdomUpdating || me.silentVdomUpdate) {
611616
resolve && VDomUpdate.addPromiseCallback(me.id, resolve);
@@ -616,7 +621,7 @@ class VdomLifecycle extends Base {
616621
resolve && VDomUpdate.addPromiseCallback(me.id, resolve);
617622

618623
// If an update is triggered on an unmounted component, we must wait for it to be mounted.
619-
if (!mounted && me.isConstructed) {
624+
if (!mounted) {
620625
// Use a flag to prevent setting up multiple `then` listeners for subsequent updates
621626
// that might arrive before the component is mounted.
622627
if (!me.isAwaitingMount) {

0 commit comments

Comments
 (0)