Skip to content

Commit 97501fe

Browse files
committed
feat(cursors): propagate operations
1 parent 35099bd commit 97501fe

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/qwik/src/core/shared/vnode/enums/chore-bits.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export const enum ChoreBits {
99
CLEANUP = 1 << 6,
1010
// marker used to identify if vnode has visible tasks
1111
VISIBLE_TASKS = 1 << 7,
12+
OPERATION = 1 << 8,
1213
DIRTY_MASK = TASKS | NODE_DIFF | COMPONENT | NODE_PROPS | COMPUTE | CHILDREN | CLEANUP,
1314
}

packages/qwik/src/core/shared/vnode/vnode-dirty.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,14 @@ export function addVNodeOperation(
5454
): void {
5555
vNode.operation = operation;
5656

57+
let parent: VNode | null;
5758
let child: VNode = vNode;
58-
let parent: VNode | null = vNode.parent || vNode.slotParent;
59-
while (
60-
parent &&
61-
!(parent.dirty & ChoreBits.DIRTY_MASK && parent.dirtyChildren?.includes(child))
62-
) {
59+
// We must make sure the flush operation finds this vNode
60+
while (!child.dirty && (parent = child.parent || child.slotParent) && !parent.dirtyChildren) {
6361
parent.dirtyChildren ||= [];
6462
parent.dirtyChildren.push(child);
65-
parent.dirty |= ChoreBits.CHILDREN;
63+
// mark a little dirty so we don't add it again
64+
child.dirty |= ChoreBits.OPERATION;
6665
child = parent;
67-
parent = parent.parent || parent.slotParent;
6866
}
6967
}

0 commit comments

Comments
 (0)