You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something has happened quite recently, when I updated the package our app started behaving weirdly.
When I append a view to a path it navigates there, and I can go back correctly to the view that I was adding. BUT the next time I append a view to the stack, the stack hasn't been popped and I now get first the view I'm currently at, and then also the view that I previously dismissed.
I tried setting a fixed package version to 0.9.3 and then the problem disappeared. So something has happened after that release.
The setup we have is that each tab gets their own @State private var pathName: NBNavigationPath = .init() on the main view of the app, that handles each tabs stacks, so the app only has three NBNavigationPath in the app, but multiple views append to them via an environment key
import SwiftUI
import NavigationBackport
struct NBNavigationEnvironmentKey: EnvironmentKey {
static var defaultValue: Binding<NBNavigationPath> = .constant(.init())
}
extension EnvironmentValues {
var navigationPath: Binding<NBNavigationPath> {
get { self[NBNavigationEnvironmentKey.self] }
set { self[NBNavigationEnvironmentKey.self] = newValue }
}
}
The text was updated successfully, but these errors were encountered:
Thanks for raising this @GioPalusa. There's some additional info that might help to pin down the issue, if you're able to provide it please:
I'd be a bit wary of passing the path via the environment in that way, as I think it can sometimes cause any screen in the stack to be recomputed when the stack is changed. I'm curious if you still see the same issue if you switch to using the @EnvironmentObject var navigator: PathNavigator environment object provided by this library?
Were you able to isolate the issue to a single version change, e.g. 0.9.3 to 0.9.4?
Are you able to provide a minimal reproduction that shows the issue?
If you're able to help with any of those, it would be really useful. Thanks!
Something has happened quite recently, when I updated the package our app started behaving weirdly.
When I append a view to a path it navigates there, and I can go back correctly to the view that I was adding. BUT the next time I append a view to the stack, the stack hasn't been popped and I now get first the view I'm currently at, and then also the view that I previously dismissed.
I tried setting a fixed package version to
0.9.3
and then the problem disappeared. So something has happened after that release.The setup we have is that each tab gets their own
@State private var pathName: NBNavigationPath = .init()
on the main view of the app, that handles each tabs stacks, so the app only has threeNBNavigationPath
in the app, but multiple views append to them via an environment keyThe text was updated successfully, but these errors were encountered: