jevonmao / jevonmao/PermissionsSwiftUI

[BUG] - iOS 15, dismissal is not working, if the showModal toggles within onAppear function of the view.

Open
#101 11 comments 11 reactions 1 assignee Claimed by @jevonmao View on GitHub
confirmed bug good first issue help wanted
Dominant language
Swift
Stars
1.6k
Forks
92
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
A clear and concise description of what the bug is.

This bug only present on iOS 15. When, the showModal boolean is set to true in .onAppear. It is not possible to dismiss the modal, unless `restrictDismissal` is set to false.
**To Reproduce**
Steps to reproduce the behavior:
Great example would be:
```
struct Dashboard: View {
@State private var showModal: Bool = false
var body: Some View {
VStack {
//some code
}.onAppear {
showModal = true
}
}
```

**Expected behavior**
A clear and concise description of what you expected to happen.
Modal with permissions will disappear when the "close" button is pressed

**Screenshots**
If applicable, add screenshots to help explain your problem.
Attached GIF recording of the issue
![ios15BUG](https://user-images.githubusercontent.com/47342870/137643185-506b28b3-820f-4f1a-8928-f6910532c8dc.gif)
**Desktop (please complete the following information):*

*
- OS: iOS 15
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
The issue is present in the simulator and in the physical device.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.