Open Notsfsssf opened 2 years ago
When I add @Environment(\.scenePhase) var scenePhase,partialSheet will auto close and never show again
@Environment(\.scenePhase) var scenePhase
import SwiftUI import PartialSheet @main struct nnonoApp: App { @State private var isPresented = false @Environment(\.openURL) private var openURL @Environment(\.scenePhase) var scenePhase // <- var body: some Scene { WindowGroup { ZStack { Rectangle().onTapGesture { isPresented = true }.partialSheet(isPresented: $isPresented) { Button { openURL(URL(string: "https://github.com")!) } label: { Label("Get Help", systemImage: "person.fill.questionmark") } } }.attachPartialSheetToRoot() } } }
https://user-images.githubusercontent.com/16934707/179238498-38f0f43b-cef7-47f7-8b90-2dec6d2f6036.mp4
When I add
@Environment(\.scenePhase) var scenePhase
,partialSheet will auto close and never show againhttps://user-images.githubusercontent.com/16934707/179238498-38f0f43b-cef7-47f7-8b90-2dec6d2f6036.mp4