Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: useIonModal dismiss() does not unmount component #23517

Closed
babycourageous opened this issue Jun 26, 2021 · 9 comments
Closed

bug: useIonModal dismiss() does not unmount component #23517

babycourageous opened this issue Jun 26, 2021 · 9 comments
Labels
package: react @ionic/react package type: bug a confirmed bug report

Comments

@babycourageous
Copy link
Contributor

babycourageous commented Jun 26, 2021

Bug 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-modal-hook-test.mov

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!
@ionitron-bot ionitron-bot bot added the triage label Jun 26, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Could you reproduce this issue in an Ionic starter app and provide a link to the repo? I see you also reported #23516, so feel free to just re-use the reproduction from there.

@liamdebeasi liamdebeasi added the ionitron: needs reproduction a code reproduction is needed from the issue author label Jun 28, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Jun 28, 2021

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Jun 28, 2021
@babycourageous
Copy link
Contributor Author

Hi Liam

Absolutely, here ya go!
https://github.com/babycourageous/ionic-react-modal-hook-issue

@liamdebeasi liamdebeasi added triage and removed ionitron: needs reproduction a code reproduction is needed from the issue author labels Jul 23, 2021
@liamdebeasi liamdebeasi added the type: bug a confirmed bug report label Aug 10, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 10, 2021
@liamdebeasi liamdebeasi added the package: react @ionic/react package label Aug 10, 2021
@liamdebeasi
Copy link
Contributor

I can reproduce this behavior. Likely related to #23516 given that the overlay is not rendered within the app context.

@babycourageous
Copy link
Contributor Author

Thanks for the update @liamdebeasi !

Yeah, i figured the two had some crossover.

@babycourageous
Copy link
Contributor Author

Hi @liamdebeasi - sorry to ping this issue- but wanted to see if it makes sense to close this issue as something that won't be addressed for v5.
I saw that #24008 was merged into the "next" branch and #23516 is closed. I can confirm v6 modal mounts and unmounts as expected; so i was curious if it would only be addressed for v6. If so, I totally understand if this is a not-fix for v5 and you can close this issue accordingly.

Thanks again!

@liamdebeasi
Copy link
Contributor

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.

@babycourageous
Copy link
Contributor Author

babycourageous commented Feb 15, 2022

Thanks so much @liamdebeasi ! That officially nudges us to upgrade to v6! ;)

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 17, 2022

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants