Skip to content

[iOS 16] App freeze when hitting back on navigation bar, using a WrappingHastack in a view as a NavigationLink  #26

@sadaf-behbahani

Description

@sadaf-behbahani

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.
Screenshot 2022-09-20 at 13 04 42

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions