Repository navigation
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v7.x
Current Behavior
When opening the modal, there's a high chance the animation lags and is not smooth.
Expected Behavior
When opening the modal, the animation should never lag. It should always be smooth.
Steps to Reproduce
- Clone the repo available at https://github.com/galash13/ionic-react-modal-issue
- Open the Xcode project and run on a device or simulator
- Try opening/closing the modal. If the issue doesn't immediately appear, try again more times and it will.
The modal is being opened and closed with the isOpen method described in the docs
Below you can find a few screen recordings of the issue on different devices
iPhone.7.iOS.15.7.3.mp4
iPhone.14.Pro.Simulator.iOS.16.2.mp4
iPhone.13.mini.iOS.16.4.1.mp4
Code Reproduction URL
Ionic Info
[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package.json'
Require stack:
- /Users/galash13/.nvm/versions/node/v19.9.0/lib/node_modules/@ionic/cli/lib/project/index.js
- /Users/galash13/.nvm/versions/node/v19.9.0/lib/node_modules/@ionic/cli/lib/index.js
- /Users/galash13/.nvm/versions/node/v19.9.0/lib/node_modules/@ionic/cli/index.js
- /Users/galash13/.nvm/versions/node/v19.9.0/lib/node_modules/@ionic/cli/bin/ionic
Ionic:
Ionic CLI : 7.0.1 (/Users/galash13/.nvm/versions/node/v19.9.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.0.4
Capacitor:
Capacitor CLI : 4.8.0
@capacitor/android : not installed
@capacitor/core : 4.8.0
@capacitor/ios : 4.8.0
Utility:
cordova-res : not installed globally
native-run : 1.7.2
System:
NodeJS : v19.9.0 (/Users/galash13/.nvm/versions/node/v19.9.0/bin/node)
npm : 9.6.3
OS : macOS 13 Ventura
Additional Information
No response
Activity
noskovvkirill commentedon May 1, 2023
We experience the same issue and it stops us from upgrading to v7
liamdebeasi commentedon May 1, 2023
As a temporary workaround you can set
keepContentsMounted="true"while we work to resolve this issue. The problem here is that the inner contents of the modal is not mounted before the animation starts.[-]bug: [Ionic-React] [iOS] Modal animation lag on open[/-][+]bug: react, modal does not wait for contents to mount before opening[/+]liamdebeasi commentedon May 1, 2023
Here is a dev build with a proposed fix:
7.0.5-dev.11682961633.14e27e07Install Example:
galash13 commentedon May 1, 2023
gave the dev build a quick test on a simulator and a device in my app and the issue is fixed! 🙌
fix(modal, popover): wait for contents to mount (#27344)
ionitron-bot commentedon Jun 2, 2023
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.