EmergeTools / Pow

Delightful SwiftUI effects for your app

Home Page:https://movingparts.io/pow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Glow blocks input on buttons

robb opened this issue · comments

I'll investigate.

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()
    }
}

Fixed in 0.3.1

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