Skip to content

Commit 63293cf

Browse files
committed
fix: retire event owners before DOM detach in batchClearItems
batchClearItems detached row DOM before calling retireEventOwner, so synchronous focusout during removal could still reach those rows' handlers. Under a staged ViewTransition commit the queued order is the same, so a published list clear could run a disposed owner and raise ScopeDisposedError. Add a retirement pre-pass before the DOM operations, matching the ordering in both unmountBlockInner and deferRootOwnedListClear which retire before detach.
1 parent fab9c74 commit 63293cf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44260,6 +44260,12 @@ function batchClearItems(
4426044260
return;
4426144261
}
4426244262
const p = domNode(state.start).parentNode!;
44263+
// Retire event owners before the DOM detach so that synchronous focusout
44264+
// (or any other removal-triggered event) sees every row as retired.
44265+
// Mirrors unmountBlockInner and the deferred owned-clear commit path.
44266+
for (let b: Block | null = state.head; b !== null; b = b.nextSibling) {
44267+
retireEventOwner(b);
44268+
}
4426344269
if (domNode(state.start).previousSibling === null && getNextSibling(state.end) === null) {
4426444270
// forBlock owns the parent — nuke everything in one DOM op, then re-add markers.
4426544271
(STAGED_DOM?.view(p as Element) ?? (p as Element)).textContent = '';

0 commit comments

Comments
 (0)