diff --git a/README.md b/README.md index 8b077f1..b977c15 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ import PackageDescription let package = Package( name: "SomeProject", dependencies: [ - .package(url: "https://github.com/dankinsoid/VDFlow.git", from: "4.11.0") + .package(url: "https://github.com/dankinsoid/VDFlow.git", from: "4.12.0") ], targets: [ .target(name: "SomeProject", dependencies: ["VDFlow"]) diff --git a/Sources/VDFlow/NavigationSteps.swift b/Sources/VDFlow/NavigationSteps.swift index 7282d2e..7410211 100644 --- a/Sources/VDFlow/NavigationSteps.swift +++ b/Sources/VDFlow/NavigationSteps.swift @@ -93,8 +93,8 @@ private struct NavigationStackWrapper: View { } ) } set: { path in - guard path.count < children.count + 1 else { return } - let i = path.count - 1 + guard path.count < children.count else { return } + let i = path.count if let tag = tag(of: children[i], i) { selection = tag } else if path.isEmpty {