Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested grid causes parent grid layout issues #20

Open
t9mike opened this issue Dec 18, 2020 · 0 comments
Open

Nested grid causes parent grid layout issues #20

t9mike opened this issue Dec 18, 2020 · 0 comments

Comments

@t9mike
Copy link

t9mike commented Dec 18, 2020

In this nested grid example, the parent layout is not expected:

var body: some View {
        Grid(tracks: [
            .fit, // label
            .fit, // value
        ], spacing: 5)
        {
            Text("A").gridAlignment(.trailing)
            Text("B").gridAlignment(.leading)
            Text("CCCCC").gridAlignment(.trailing)
            Text("D").gridAlignment(.leading)
            Text("Grid->").gridAlignment(.trailing)
            Grid(tracks: [
                .fit, // label
                .fit, // value
            ], spacing: 3) {
                Text("W").gridAlignment(.leading)
                Text("X").gridAlignment(.trailing)
                Text("YYYY").gridAlignment(.leading)
                Text("ZZZZ").gridAlignment(.trailing)
            }
            .border(Color.red, width: 1)
        }
        .border(Color.blue, width: 1)
    }

image

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

No branches or pull requests

1 participant