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

Navigating back causes animation to get toggled multiple times #55

Open
thisIsTheFoxe opened this issue May 21, 2024 · 0 comments
Open

Comments

@thisIsTheFoxe
Copy link

Hey, thanks for the last fix.. <3 super cool project..!

I just noticed another bug while playing around with it hehe

Describe the bug
When navigating back to a view that has a loading state, the onAppear function is called multiple times. This causes the (repeat-forever) animation to be 'toggled' multiple times.

To Reproduce
Steps to reproduce the behavior:
0. View with skeleton modifier inside a NavigationStack

  1. Navigate to a detail view
  2. navigate back to the original view

Expected behavior
The skeleton animation should play normally.

Screenshots
Didn't find any.. can try to reproduce and add one if needed..?

Additional context
The problem is the .toggle() which is called at onAppear. I found one solution is to check animate == false or instead of toggling just setting the value to true.
For reference, my solution: 64f6246

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