[DevTools] Stop recording reorders in disconnected subtrees (#34464)

This commit is contained in:
Sebastian "Sebbie" Silbermann 2025-09-11 19:13:14 +02:00 committed by GitHub
parent 67415c8c4a
commit 7fc888dde2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4310,7 +4310,9 @@ export function attach(
virtualLevel + 1, virtualLevel + 1,
); );
if ((updateFlags & ShouldResetChildren) !== NoUpdate) { if ((updateFlags & ShouldResetChildren) !== NoUpdate) {
recordResetChildren(virtualInstance); if (!isInDisconnectedSubtree) {
recordResetChildren(virtualInstance);
}
updateFlags &= ~ShouldResetChildren; updateFlags &= ~ShouldResetChildren;
} }
removePreviousSuspendedBy( removePreviousSuspendedBy(
@ -5097,7 +5099,9 @@ export function attach(
// We need to crawl the subtree for closest non-filtered Fibers // We need to crawl the subtree for closest non-filtered Fibers
// so that we can display them in a flat children set. // so that we can display them in a flat children set.
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) { if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
recordResetChildren(fiberInstance); if (!nextIsHidden && !isInDisconnectedSubtree) {
recordResetChildren(fiberInstance);
}
// We've handled the child order change for this Fiber. // We've handled the child order change for this Fiber.
// Since it's included, there's no need to invalidate parent child order. // Since it's included, there's no need to invalidate parent child order.