Skip to content

bug: Viewport changes in an IonPage containing a card type IonModal cause an unwanted IonPage animation #30679

Closed

Description

@Pablosornp

Prerequisites

Ionic Framework Version

v8.7.3

Current Behavior

Changing the viewport layout (switching between landscape an portrait mode in mobile devices or between mobile and desktop mode in the browser devtools) triggers the presentingElement IonPage animation used when a Card Modal is opened (leaning back into the background) although the modal was never opened.

When the modal is opened the animation works fine. It seems like Ionic detects the viewport change and tries to adapt the card modal and IonPage acting as presenting element, whether it is open (correct) or closed (unwanted behavior). This only occurs in IonPage's that contain a Card Modal.

You can watch this glitch in the following video:

Screencast.from.11-09-25.10.56.55.webm

I have also created a stackblitz sandbox with a minimal project to reproduce the problem seen in the video:

https://stackblitz.com/edit/laa3hcpx-qkdepaut

Expected Behavior

If the modal is not opened, viewport changes should not trigger the leaning back animation in the presentingElement IonPage that contains the Card Modal.

Steps to Reproduce

  1. Set up an Ionic React project with an IonPage containing a Card Modal or test it in this sandbox
  2. Change the viewport dimensions by either:
    -- Switching between landscape and portrait modes in mobile devices
    -- Switching between landscape and portrait modes in the browser devtools.
    -- In Android devices focusing on the IonSearchBar also triggers the error since the virtual keyboard changes the viewport.
  3. See how the IonPage animates as if a CarModal is being opened, leaning back, and it stays that way until you open and close the modal or restart the app.

Code Reproduction URL

https://stackblitz.com/edit/laa3hcpx-qkdepaut

Ionic Info

[WARN] You are not in an Ionic project directory. Project context may be missing.

Ionic:

Ionic CLI : 7.2.1

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v22.19.0
npm : 11.5.2
OS : Linux 6.8

Additional Information

Please mind that i am only using the Ionic Components in an existing React Project. I am not using Capacitor or any of the other native features. I'm using Ionic version 8.7.3.

Activity

  1. changed the title [-]bug: Viewport changes in an IonPage containing a Card Ion Modal causes and unwanted IonPage animation[/-] [+]bug: Viewport changes in an IonPage containing a Card IonModal causes and unwanted IonPage animation[/+] on Sep 11, 2025
  2. changed the title [-]bug: Viewport changes in an IonPage containing a Card IonModal causes and unwanted IonPage animation[/-] [+]bug: Viewport changes in an ```IonPage``` containing a Card ```IonModal``` causes and unwanted ```IonPage``` animation[/+] on Sep 11, 2025
  3. changed the title [-]bug: Viewport changes in an ```IonPage``` containing a Card ```IonModal``` causes and unwanted ```IonPage``` animation[/-] [+]bug: Viewport changes in an ```IonPage``` containing a Card ```IonModal``` causes an unwanted ```IonPage``` animation[/+] on Sep 11, 2025
  4. changed the title [-]bug: Viewport changes in an ```IonPage``` containing a Card ```IonModal``` causes an unwanted ```IonPage``` animation[/-] [+]bug: Viewport changes in an ```IonPage``` containing a card type ```IonModal``` cause an unwanted ```IonPage``` animation[/+] on Sep 11, 2025
  5. added
    needs: investigationThis issue is waiting on more investigation from the engineering team.
    on Sep 26, 2025
  6. thetaPC commented on Sep 26, 2025

    @thetaPC
    Contributor

    Thank you for submitting the issue!

    I was able to replicate the issue on Chrome, Edge, and Safari. There's no issue on Firefox. We'll need to investigate further to determine the cause.

  7. rendom commented on Oct 23, 2025

    @rendom

    Any update or workaround? Similar issues with ionic/vue.

  8. rendom commented on Oct 24, 2025

    @rendom

    handleViewTranslation is triggered on window resize (if mode is iOS) and its starting the transitionAnimation even if the modal is closed. this.currentViewIsPortrait is undefined so its triggered even if the orientation is changed or not.

  9. AkhmetKG commented on Oct 24, 2025

    @AkhmetKG

    We have a similar issue with ionic/angular. Hopefully, this will be fixed soon.

  10. scr2em commented on Oct 27, 2025

    @scr2em

    Any updates?

  11. akozyritskiy commented on Oct 28, 2025

    @akozyritskiy

    We have encountered the same issue in our angular application also ..
    Any updates on when this will be fixed?

  12. Pablosornp commented on Dec 11, 2025

    @Pablosornp
    Author

    This must be affecting more users. We had to replace all CarModals with SheetModals because of this issue. Is there an estimated investigation timeline?

  13. added theissue type on Dec 29, 2025
  14. ShaneK commented on Dec 29, 2025

    @ShaneK
    Member

    Hey! Sorry, this was a massive oversight on my part. I have a very simple PR up that will fix it (but may not be merged until after our team is back from holiday vacations).

    If you'd like to try it now, there's a dev build here:

    8.7.16-dev.11767028735.16932cea
    
  15. added a commit that references this issue on Dec 30, 2025
    e5634d4
  16. ShaneK commented on Dec 31, 2025

    @ShaneK
    Member

    The fix for this was released today in v8.7.16. Thanks for the report!

  17. added a commit that references this issue on Dec 31, 2025
    36f4b4d
  18. ionitron-bot commented on Jan 30, 2026

    @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.

  19. locked and limited conversation to collaborators on Jan 30, 2026
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

    needs: investigationThis issue is waiting on more investigation from the engineering team.type: buga confirmed bug report

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions