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

ZStack doesn't render it's contents frames well #390

Open
Joannis opened this issue Mar 7, 2021 · 2 comments
Open

ZStack doesn't render it's contents frames well #390

Joannis opened this issue Mar 7, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Joannis
Copy link
Contributor

Joannis commented Mar 7, 2021

Describe the bug
A ZStack doesn't respect its childrens' frame preferences. They're aligned in a grid which is constrained in size. So the ZStack renders its 'expected size' (without taking #387 into consideration). But the contents of this ZStack don't follow this pattern.

To Reproduce

struct TokamakApp: App {
    var body: some Scene {
        WindowGroup("Tokamak App") {
            ContentView()
        }
    }
}

struct ContentView: View {
    var body: some View {
        ZStack {
            Color(white: 0.15).frame(
                minWidth: 0,
                maxWidth: .infinity,
                minHeight: 0,
                maxHeight: .infinity
            )
        }.frame(
            minWidth: 0,
            maxWidth: .infinity,
            minHeight: 0,
            maxHeight: .infinity
        )
    }
}

Expected behavior
The ZStack is rendered full-screen and its contents also are rendered in the full size of the ZStack frame.

Screenshots
The view is black on the left, but nothing renders throughout the right.

image

Desktop (please complete the following information):

  • OS: macOS
  • Browser Safari
  • Version of the browser 14.0.3 (16610.4.3.1.4)
  • Version of Tokamak 0.6.1

Additional context
Add any other context about the problem here.

@Joannis Joannis added the bug Something isn't working label Mar 7, 2021
@j-f1
Copy link
Member

j-f1 commented Mar 7, 2021

I think a lot of these things will be fixed by abandoning CSS layout in favor of a custom solution in #379

@Joannis
Copy link
Contributor Author

Joannis commented Mar 7, 2021

Thanks @j-f1, I hope so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants