From cbb75da637d569d47d9f6636152b7f43ad09bea5 Mon Sep 17 00:00:00 2001 From: Jinwoo Kim Date: Mon, 29 Dec 2025 23:25:51 +0900 Subject: [PATCH 1/2] Fix incorrect index update in updateItems --- Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift b/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift index 216f0a3a5..03a9dc2a5 100644 --- a/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift +++ b/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift @@ -611,10 +611,10 @@ struct DynamicContainerInfo: StatefulRule, AsyncAttribute, ObservedAttr let zIndex = infoItem.zIndex hasDepth = hasDepth || (zIndex != 0) if zIndex != info.items[target].zIndex { - info.items[target].zIndex = zIndex + info.items[index].zIndex = zIndex changed = true } - if phase != info.items[target].phase { + if phase != info.items[index].phase { changed = true } } From d3d2434b0b002995c254d57245cc1b7b7c11fdfe Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 4 Jan 2026 04:03:26 +0800 Subject: [PATCH 2/2] Add comments --- Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift b/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift index 03a9dc2a5..2be3f3892 100644 --- a/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift +++ b/Sources/OpenSwiftUICore/Layout/Dynamic/DynamicContainer.swift @@ -611,7 +611,7 @@ struct DynamicContainerInfo: StatefulRule, AsyncAttribute, ObservedAttr let zIndex = infoItem.zIndex hasDepth = hasDepth || (zIndex != 0) if zIndex != info.items[target].zIndex { - info.items[index].zIndex = zIndex + info.items[index].zIndex = zIndex // Weird. No-op actually. changed = true } if phase != info.items[index].phase {