Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jpsim
Created June 14, 2020 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpsim/9bea8715291850e0bc3c6042eee10db5 to your computer and use it in GitHub Desktop.
Save jpsim/9bea8715291850e0bc3c6042eee10db5 to your computer and use it in GitHub Desktop.
FB7736428: SwiftUI navigation bar items unresponsive

With the following code:

import SwiftUI

struct ContentView: View {
    @State private var showPopover = false

    var body: some View {
        NavigationView {
            List {
                EmptyView()
            }
            .popover(isPresented: $showPopover, content: EmptyView.init)
            .navigationBarItems(
                trailing: Button("Show") {
                    self.showPopover = true
                }
            )
        }
    }
}

Follow these steps to reproduce the issue:

  1. Tap "Show"
  2. Drag modal down to dismiss
  3. Tap "Show" again repeatedly
  4. Notice that there is no effect
  5. Scroll the List
  6. Tap "Show" again
  7. Notice that the modal is shown once again
@jpsim
Copy link
Author

jpsim commented Jul 16, 2021

Fixed as of iOS 14.6, maybe earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment