Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glow blocks input on buttons #29

Closed
robb opened this issue May 22, 2023 · 3 comments
Closed

Glow blocks input on buttons #29

robb opened this issue May 22, 2023 · 3 comments

Comments

@robb
Copy link
Contributor

robb commented May 22, 2023

I'll investigate.

@ericlewis
Copy link

ericlewis commented May 22, 2023

import SwiftUI
import Pow

struct ContentView: View {
    @State
    private var active = false
    
    var body: some View {
        NavigationView {
            Rectangle()
                .sheet(isPresented: .constant(true)) {
                    NavigationView {
                        Text("Is active: \(active ? "yes" : "no")")
                            .safeAreaInset(edge: .bottom) {
                                Button(role: active ? .destructive : nil) {
                                    active.toggle()
                                } label: {
                                    if active == true {
                                        Label("Stop Listening", systemImage: "stop.fill")
                                    } else {
                                        Label("Start Listening", systemImage: "shazam.logo")
                                    }
                                }
                                .conditionalEffect(.repeat(.glow(color: .blue, radius: 50), every: 1.5), condition: !active)
                                .animation(.default, value: true)
                                .buttonStyle(.borderedProminent)
                                .buttonBorderShape(.capsule)
                                .controlSize(.large)
                                .keyboardShortcut(.defaultAction)
                                .imageScale(.large)
                                .shadow(radius: 4)
                            }
                    }
                    .presentationDetents([.medium, .large])
                    .presentationBackgroundInteraction(
                        .enabled(upThrough: .medium)
                    )
                    .presentationDragIndicator(.hidden)
                    .interactiveDismissDisabled()
                }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

@robb robb mentioned this issue May 23, 2023
@robb
Copy link
Contributor Author

robb commented Jun 3, 2023

Fixed in 0.3.1

@robb robb closed this as completed Jun 3, 2023
@iTarek
Copy link

iTarek commented Dec 13, 2023

This issue is back on the last version. Can you please fix again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants