jevonmao / jevonmao/PermissionsSwiftUI
[BUG] - iOS 15, dismissal is not working, if the showModal toggles within onAppear function of the view.
- 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

**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
Assessment
This issue has not been assessed yet.