jevonmao / PermissionsSwiftUI

A SwiftUI package to beautifully display and handle permissions.

Home Page:https://jevonmao.github.io/PermissionsSwiftUI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] - Modal Style. Dismiss button. Not working

FedorovMisha opened this issue · comments

Describe the bug
Having tried to run the first example, I caught this error. The cross button does not work. It doesn't close the modal window.

To Reproduce
Steps to reproduce the behavior:

  1. Insert this in ContentView.swift

    struct ContentView: View {
    @State var showModal = false
    var body: some View {
    Button(action: {
    showModal=true
    }, label: {
    Text("Ask user for permissions")
    })
    .JMModal(showModal: $showModal, for: [.locationAlways, .photo, .microphone])
    }
    }
    2. Run app
    3. Click on button
    3. Tap on dismiss button

Expected behavior
Dismiss button not working

Screenshots

Desktop (please complete the following information):

  • OS: iOS 15.5

When trying to find what the problem is, I came across these lines
Screenshot 2022-11-05 at 23 54 29

Screenshot 2022-11-05 at 23 50 59

In this lines you return .constant(true) / .constant(false). In my opinion you must return not constant binding value

@FedorovMisha
image
Thanks for reaching out, does this address your question?