-
Notifications
You must be signed in to change notification settings - Fork 68
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
Screen is dismissed twice when swiping down on a sheet #64
Comments
Thanks for raising this @rdonnelly ! This seems to be an issue introduced in iOS 17 when using view models - I was able to reproduce the issue in the project's demo app. I'll need to dig a bit deeper to understand what's going on, so thank you for the clear reproduction. |
Awesome, thanks for the confirmation and for taking a look, @johnpatrickmorgan! And obviously no rush, definitely digging the library and approach! 👏 |
I had a similar issue with a |
@johnpatrickmorgan any ideas what is causing this? I spent a few hours the other day trying to dig into it but came up empty. Tried a bunch of different things but wasnt able to get it to stop. Happy to continue to dig more! Just curious if you had any ideas or a hunch about whats going on. Btw huge thanks for the library! |
Thanks a lot @wickwirew for looking into this - I've also been stumped. One thing I tried was adding a Binding wrapper to log the get and set: extension Binding {
func withLogging<T>(_ transform: @escaping (Value) -> T) -> Binding {
return Binding(
get: {
print("getting \(transform(wrappedValue))")
return wrappedValue
},
set: { newValue in
print("setting from \(transform(wrappedValue)) to \(transform(newValue))")
wrappedValue = newValue
}
)
}
} And then initialising the Router with
But I haven't been able to figure out why yet. |
Huh strange, I actually did something similar and got different results. In the var binding: Binding<Routes<Screen>> {
Binding {
print("getting: \(coordinatorViewModel.routes.count)")
return coordinatorViewModel.routes
} set: { newValue in
print("setting from \(coordinatorViewModel.routes.count) to \(newValue.count)")
coordinatorViewModel.routes = newValue
}
} Which logs the correct values. Which I guess makes since its reading directly from the source of truth. Very weird the extension prints an old value though.
I was able to replicate what you saw with that |
I am having the same issue, it is really annoying. Any way to work around it? |
I've tracked down the problem to the addition of the
Removing that line avoids the issue. But strangely, it seems to also be overcome by just observing the flow navigator in |
I've refactored |
Hi there! I am admittedly pretty green with iOS development and the framework, but learning lots and having fun. I'm running into some interesting behavior when playing with mixing navigation types. Basically, if I
push
a screen onto the stack, thenpresentSheet
another screen, then dismiss the sheet with a swipe down, I get a double dismiss animation:Manually dismissing the sheet works just fine. I built a small repro app to see the behavior:
https://github.com/rdonnelly/FlowStacksDoubleDismiss
Definitely willing to consider other approaches if something seems fishy in the code! Thanks!
The text was updated successfully, but these errors were encountered: