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: ionic react, modal inner component unmounted too early #22761

Closed
nickwang0808 opened this issue Jan 13, 2021 · 8 comments · Fixed by #22763
Closed

bug: ionic react, modal inner component unmounted too early #22761

nickwang0808 opened this issue Jan 13, 2021 · 8 comments · Fixed by #22763
Labels
package: react @ionic/react package type: bug a confirmed bug report
Milestone

Comments

@nickwang0808
Copy link

nickwang0808 commented Jan 13, 2021

Bug Report

Ionic version:

[ ] 4.x
[x] 5.x

Current behavior:
when closing <IonModal isOpen={showModal} /> via setting showModal to false, the modal would exit with a flicker, it does not flicker away when closing is with the ESC key on the keyboard

Expected behavior:
the modal should animate the same way as if it was close with the ESC key, aka smoothly

Steps to reproduce:
simply create a modal and toggle it with showModal state in React

Related code:

please see codesandbox example here
https://codesandbox.io/s/zealous-poincare-1sih7?file=/src/pages/Home.tsx

all logical code is in src/components/home directory

Other information:
please see the gif below, first, 2 clicks are with the mouse, last 2 are with the ESC key, notice how with the ESC key it slides out but with a mouse click it flickers to white while sliding out
ionmodal

Ionic info:
image

at the end I would like to thank the ionic team for making something this exceptional, and I appreciate any help from you.

@ionitron-bot ionitron-bot bot added the triage label Jan 13, 2021
@liamdebeasi liamdebeasi added package: react @ionic/react package type: bug a confirmed bug report labels Jan 13, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. It looks like the modal's inner component is being unmounted too early. It should be unmounted after the onDidDismiss not after onWillDismiss.

@liamdebeasi liamdebeasi changed the title bug: Ion/react IonModal animation flicker when closed via state bug: ionic react, modal component unmounted too early Jan 13, 2021
@liamdebeasi liamdebeasi changed the title bug: ionic react, modal component unmounted too early bug: ionic react, modal inner component unmounted too early Jan 13, 2021
@nickwang0808
Copy link
Author

Thanks for the issue. It looks like the modal's inner component is being unmounted too early. It should be unmounted after the onDidDismiss not after onWillDismiss.

thank you for you quick reply.
so is there anything I can do on my end or is it something on the ionic side?

@liamdebeasi
Copy link
Contributor

This is a bug on the Ionic side, but we are looking into a fix now.

@nickwang0808
Copy link
Author

This is a bug on the Ionic side, but we are looking into a fix now.

thank you very much!

@liamdebeasi
Copy link
Contributor

Can you try the following dev build and let me know if it resolve the issue?

npm install @ionic/react@5.6.0-dev.202101131554.1c08e5b @ionic/react-router@5.6.0-dev.202101131554.1c08e5b

I would give this a try in one of your local applications. CodeSandbox seems to have trouble installing dev builds of Ionic.

@liamdebeasi liamdebeasi added this to the 5.5.3 milestone Jan 13, 2021
@nickwang0808
Copy link
Author

Can you try the following dev build and let me know if it resolve the issue?

npm install @ionic/react@5.6.0-dev.202101131554.1c08e5b @ionic/react-router@5.6.0-dev.202101131554.1c08e5b

I would give this a try in one of your local applications. CodeSandbox seems to have trouble installing dev builds of Ionic.

Yes it seems like this dev build has the bug fixed!

@liamdebeasi
Copy link
Contributor

Glad it is working now! This has been resolved via #22763, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 13, 2021

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 Feb 13, 2021
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
2 participants