joogps / SlideOverCard

A SwiftUI card view, made great for setup interactions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chichkanov opened this issue · 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.

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-11.at.14.31.41.mp4

having the same issue here