rechsteiner / Parchment

A paging view with a highly customizable menu ✨
MIT License
3.35k stars 417 forks source link

Navigation bar disappear when presented in a sheet. #691

Closed Scocher closed 7 months ago

Scocher commented 10 months ago

If you present a ParchmentView in a NavigationView in a sheet for swiftUI, the navigation bar disappear when the first page title goes off screen.

In the ExampleApp. This is the code a used to reproduced the bug.

struct ExampleApp: App {
  @State var isPresentingDefault: Bool = false
  var body: some Scene {
    WindowGroup {
      NavigationView {
        List {
          Button("Default Sheet") { isPresentingDefault = true }
          NavigationLink("Default", destination: DefaultView())
          NavigationLink("Change selected index", destination: SelectedIndexView())
          NavigationLink("Lifecycle events", destination: LifecycleView())
          NavigationLink("Change items", destination: ChangeItemsView())
        }
        .navigationBarTitleDisplayMode(.inline)
        .sheet(isPresented: $isPresentingDefault, content: {
          NavigationView(content: {
            ChangeItemsView()
              .navigationTitle("Default")
              .navigationBarTitleDisplayMode(.inline)
          })
        })
      }
    }
  }
}

bug

rechsteiner commented 8 months ago

Hi @Scocher! Thanks for reporting the issue. Which iOS and Parchment version are you using? Your example seems to work just fine when I'm running on iOS 17, so maybe it's a SwiftUI bug that has been fixed by Apple?

Scocher commented 7 months ago

It seems like Apple has fixed this bug. I can still recreated the bug in 17.0.1 simulator. But works in 17.2.

Scocher commented 7 months ago

I will close this, since it seems to be an apple bug.