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

Flicker when using bottom sheet starting with isPresented == false #21

Closed
joncottrell opened this issue Jun 30, 2022 · 5 comments
Closed

Comments

@joncottrell
Copy link
Contributor

The way to reproduce is to put a simple Rectangle in the BottomSheet and start with isPresented = false. While the GeometryReader is loading, the offset is incorrect and creates a flicker.

@nimrodbens
Copy link

nimrodbens commented Jul 26, 2022

same here. did you do something about it?

edit: actually i did not have the bottomSheet modifier on the outmost view in my view hierarchy, moving it to the outmost one fixed it for me.

@joncottrell
Copy link
Contributor Author

Yes, I can see how that would fix it but I don't want to pollute my topmost view with this logic. So my hack to fix it was keep bottom views alpha at 0 and in onAppear I switch it on after a short delay. I think the root problem is unless at the top level view, the geometry reader evaluates to zero the first time body gets called. A quick fix would be to have the bottom sheet return nothing when that is the case.

@joncottrell
Copy link
Contributor Author

Maybe I'll do a pull request at some point

@weitieda
Copy link
Owner

@nimrodbens Should be fixed by #22 and shout out to @joncottrell for working on this, thanks.

@weitieda
Copy link
Owner

Closing this issue for now and feel free to open new one if necessary

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

3 participants