[Android]Modal becomes invalid state when power button is pressed.
See original GitHub issue- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
Run react-native info
in your terminal and paste its contents here.
Environment:
OS: macOS High Sierra 10.13.4
Node: 8.3.0
Yarn: 1.6.0
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4819257
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description
This issue only confirmed in Android 7.x Pressing power button when Modal component is displayed causes invalid state of Modal. I see Modal contents disappears but its transparent background remains after Pressing power button again and screens turns on.
With Android 6.x or 8.x, Both modal contents won’t be hidden with the same operation.
Reproducible Demo
The code is almost same as Modal official document
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How to prevent a dialog from closing when a button is clicked
You will need to set this in the onResume() method because getButton() will return null until after the dialog has been shown!
Read more >Close modal when android back button pressed #115 - GitHub
I have the problem when keyboard is shown. In that case callback passed to onBackButtonPress is only fired on second back button press...
Read more >androidx.compose.material - Android Developers
Executes when the user tries to dismiss the Dialog by clicking outside or pressing the back button. This is not called when the...
Read more >OnePlus 7 Pro fingerprint BiometricPrompt does not show
Modal is maintained with ability to cancel by touching outside of modal or by actual 'cancel' button. With modal retained - 'retry' is...
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
Common Mistake #5: Not Using Named Views With UI-ROUTER For Power”. The de facto routing solution for AngularJS has been, until now, the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Workaround Snippet:
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.