Skip to content

bug: react, modal does not wait for contents to mount before opening #27343

Closed

Description

@galash13

Prerequisites

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

  1. Clone the repo available at https://github.com/galash13/ionic-react-modal-issue
  2. Open the Xcode project and run on a device or simulator
  3. 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

https://github.com/galash13/ionic-react-modal-issue

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

  1. self-assigned this
    on May 1, 2023
  2. noskovvkirill commented on May 1, 2023

    @noskovvkirill

    We experience the same issue and it stops us from upgrading to v7

  3. liamdebeasi commented on May 1, 2023

    @liamdebeasi
    Contributor

    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.

  4. changed the title [-]bug: [Ionic-React] [iOS] Modal animation lag on open[/-] [+]bug: react, modal does not wait for contents to mount before opening[/+] on May 1, 2023
  5. added
    package: react
    type: bug
    on May 1, 2023
  6. removed their assignment
    on May 1, 2023
  7. liamdebeasi commented on May 1, 2023

    @liamdebeasi
    Contributor

    Here is a dev build with a proposed fix: 7.0.5-dev.11682961633.14e27e07

    Install Example:

    npm install @ionic/[email protected] @ionic/[email protected]
    
  8. galash13 commented on May 1, 2023

    @galash13
    Author

    gave the dev build a quick test on a simulator and a device in my app and the issue is fixed! 🙌

  9. added a commit that references this issue on May 3, 2023
    c98ad6f
  10. ionitron-bot commented on Jun 2, 2023

    @ionitron-bot

    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.

  11. locked and limited conversation to collaborators on Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: reacttype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions