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
Describe the bug
On iOS 16, app meets a severe hang when using a wrappingHastack inside of a navigation link if you hit back button on the navigation bar.
To Reproduce
Steps to reproduce the behavior:
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
NavigationLink("Hit me ") {
WrappingView()
}
}
}
}
}
import WrappingHStack
struct WrappingView: View {
@State private var array: [String] = []
var body: some View {
VStack {
WrappingHStack(array,
id: \.self,
alignment: .center,
spacing: .constant(10)) { topic in
Text(topic)
}
}
.onAppear {
array = ["test",
"test3",
"test4",
"test5",
"test6",
"test7"]
}
}
}
run the app with code above,
hit the navigation link
hit back button on the navigation bar
Expected behavior
Go back the previous screen and not freeze the app
Screenshots
If applicable, add screenshots to help explain your problem.
Context:
WrappingHStack version: [e.g. 2.2.1]
Model: iPhone 13 pro, simulator , iPhone 11
OS: iOS 16
Additional context
Freeze happens only if you use this lib inside of a Navigation link
The text was updated successfully, but these errors were encountered:
It seems to be related to an issue when using NavigationLink with contained GeometryReaders that are not inside a NavigationView. The workaround is to set a NavigationView around the WrappingHStack.
In your example, you could use:
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
NavigationLink("Hit me ") {
WrappingView()
}
}
}
}
}
import WrappingHStack
struct WrappingView: View {
@State private var array: [String] = []
var body: some View {
NavigationView { // <<<< HERE
VStack {
WrappingHStack(array,
id: \.self,
alignment: .center,
spacing: .constant(10)) { topic in
Text(topic)
}
}
.onAppear {
array = ["test",
"test3",
"test4",
"test5",
"test6",
"test7"]
}
}
}
}
Describe the bug
On iOS 16, app meets a severe hang when using a wrappingHastack inside of a navigation link if you hit back button on the navigation bar.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Go back the previous screen and not freeze the app
Screenshots
If applicable, add screenshots to help explain your problem.
Context:
Additional context
Freeze happens only if you use this lib inside of a Navigation link
The text was updated successfully, but these errors were encountered: