Skip to content

bug: IonModal with presentingElement doesn't render on iOS #28352

@oleksandr-danylchenko

Description

@oleksandr-danylchenko

Describe the Bug

When using the "Card modal" component, we noticed that it doesn't render its content after switching the viewport orientation back and forth:

Screen.Recording.2023-10-12.at.16.19.23.mov

Unfortunately, using the "Layers" tool I didn't notice any irregularities:
image
image

However, the issue doesn't happen if you rotate the device with the opened modal:

Screen.Recording.2023-10-12.at.18.41.19.mov

Or you don't open the modal in the horizontal view:

Screen.Recording.2023-10-12.at.18.42.43.mov

Moreover, the issue doesn't happen at all when the presentingElement is removed from the IonModal, thus removing the "Card effect":
image

Screen.Recording.2023-10-12.at.18.57.17.mov

Expected Behavior

The modal is consistently opened and rendered both in the vertical and horizontal modes. Prior openings of the modal shouldn't impact its rendering in the following ones. In short: should work like in the docs and demos 👌🏻

Steps to Reproduce

This bug can be reproduced using the official "Card Modal" example:

  1. Open the example in Stackblitz
  2. Open the preview in a new tab
  3. Enable mobile view testing
  4. Choose an iPhone device
  5. Vertical Open -> Close
  6. Rotate the view
  7. Horizontal Open -> Close
  8. Rotate the view
  9. Vertical Open

Then you'll see that the modal's content isn't rendered.

The issue happens not only on the Web but on real iOS devices as well.

Operating System

Macbook Pro, M1 2021, MacOS Sonoma 14.0

Browser

Chrome

Version

117.0.5938.149

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions