Skip to content

Conversation

@jcmosc
Copy link
Contributor

@jcmosc jcmosc commented Dec 2, 2025

An item in a dynamic container may be missing a preference if, say, it does not return a display list:

struct MyEmptyView: View, PrimitiveView, UnaryView {
    func _makeView(view: _GraphValue<Self>, inputs: _ViewInputs) -> _ViewOutputs {
        _ViewOutputs()
    }
}

Spacer is an example of this.

When such a view is placed in a dynamic list such as a ForEach, any subsequent views fail to render because their display lists are never combined.

Copy link
Collaborator

@Kyle-Ye Kyle-Ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Would you mind adding a ui test in Example/OpenSwiftUIUITests to cover the fix?

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Dec 12, 2025

augment review

@augmentcode
Copy link

augmentcode bot commented Dec 12, 2025

Sorry, Augment does not have access to the org this pull request's branch is from.

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Dec 13, 2025

The current fix solve some case but still have issue for other case.

eg.

struct ContentView: View {
    var body: some View {
        VStack {
            Color.red
            Color.green
            ForEach(0 ..< 1) { index in
                Spacer()
                Color.blue
            }
        }
    }
}

@Kyle-Ye Kyle-Ye merged commit c5070c9 into OpenSwiftUIProject:main Dec 13, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants