SlideOverCard icon indicating copy to clipboard operation
SlideOverCard copied to clipboard

Sheet with .slideOverCard(item...) modifier can't be opened the second time

Open chichkanov opened this issue 10 months ago • 1 comments

Steps to repro

  1. Open the sheet
  2. Close it
  3. Try to open again -> the UI is not clickable. Seems like the Window is not dismissed properly

Env Simulator iPhone 15 pro max, iOS 17.4

When I use .slideOverCard(isPresented...) modifier everything works fine

Code sample

struct Sheet3: Identifiable {
    var id: String { title }
    let title: String
}

struct ContentView: View {
    
    @State private var showSheet3: Sheet3? = nil
    
    var body: some View {
        VStack {
            // Can't click again once dismissed
            Button("Show sheet #3") { showSheet3 = .init(title: "Sheet #3")  }
        }
        .slideOverCard(item: $showSheet3, onDismiss: { print("Sheet #3 dismiss") }) { sheet3 in
            Text(sheet3.title)
        }
    }
}

Video

When I dismissed the sheet I was trying to click on a Button again.

https://github.com/joogps/SlideOverCard/assets/22872688/330bed9a-f067-4d5e-b58e-8a1018f36b68

chichkanov avatar Apr 11 '24 11:04 chichkanov