bug: useIonModal dismiss() does not unmount component
See original GitHub issueBug Report
Ionic version:
[ ] 4.x [ x] 5.x [ ] 6.x
Current behavior:
The new useIonModal
hook does not unmount the component that is being used as the modal when dismiss()
is called.
Expected behavior:
The present
function mounts the component and the dismiss
function unmounts and removes the component from the React tree.
Steps to reproduce:
Follow the docs for useIonModal
Related code:
Below is a video of the react component tree as i present
and dismiss
the modal using the return tuple from useIonModal()
Ionic info:
Ionic:
Ionic CLI : 5.4.16 (/Users/rene/.npm/_npx/23301/lib/node_modules/ionic)
Ionic Framework : @ionic/react 5.6.10
Capacitor:
Capacitor CLI : 2.4.6
@capacitor/core : 2.4.7
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v12.16.3 (/Users/rene/.nvm/versions/node/v12.16.3/bin/node)
npm : 6.14.4
OS : macOS Mojave```
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
bug: Conditionally rendering ionModal in react - Failed to ...
I tried the fix with having const [isOpen, setIsOpen] = useState(true); inside the modal component. Unfortunately it does not dismiss the modal.
Read more >ion-modal: Ionic Mobile App Custom Modal ... - Ionic Framework
ion-modal is a dialog that appears on top of mobile app content, and must be dismissed before interaction resumes. Learn more about custom...
Read more >Ionic Modal On Dismiss Bug - Stack Overflow
But curiously this modal.onDismiss() passing data is not fired on the page when I'm on the web. It only fires when is a...
Read more >@ionic/angular | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >Source - GitHub
... Bug Fixes * **react:** do not unmount overlay inner component until overlay is dismissed ([#22813](https://github.com/ionic-team/ionic/issues/22813)) ...
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 FreeTop 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
Top GitHub Comments
Thanks for the ping! I can confirm that this issue will only be fixed in Ionic 6. Ionic 5 is only receiving critical security fixes now.
I am going to close this as this issue is resolved in Ionic 6.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.