Skip to content

bug: Fixed slot in ion-modal sometimes behind content in iOS #24286

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

Closed
5 of 6 tasks
tho-masn opened this issue Nov 29, 2021 · 5 comments · Fixed by #24300
Closed
5 of 6 tasks

bug: Fixed slot in ion-modal sometimes behind content in iOS #24286

tho-masn opened this issue Nov 29, 2021 · 5 comments · Fixed by #24300
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@tho-masn
Copy link

tho-masn commented Nov 29, 2021

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

There is some strange behaviour when using fixed slots in ion-modals in Ionic Vue. Usually the fixed slot should appear above the content of the modal. This works fine in Chrome (Desktop). But as soon as I run the code in the iOS app, the fixed slot is behind the content. I've tried to reproduce the behaviour in a minimal repo: https://github.com/tho-masn/ionic-issues/tree/v5_modal_fixed_slot_overlap
Same is happening in Ionic Vue 6.0.0-rc.3: https://github.com/tho-masn/ionic-issues/tree/v6_modal_fixed_slot_overlap

I've also tried to debug it with the Safari Devtools. Looks like as soon as I update any CSS property of the ion-modal component some rerendering happens and the fixed slot appears above the content.

Chrome (correct):
Bildschirmfoto 2021-11-29 um 17 54 15

iOS (wrong):
IMG_4212

Expected Behavior

Fixed slots should always appear in the front.

Steps to Reproduce

Check out the Repo URLs and run it on your iOS device.

Code Reproduction URL

Ionic Vue v5.9.1: https://github.com/tho-masn/ionic-issues/tree/v5_modal_fixed_slot_overlap
Ionic Vue v6.0.0-rc.3: https://github.com/tho-masn/ionic-issues/tree/v6_modal_fixed_slot_overlap

Ionic Info

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 29, 2021
@averyjohnston averyjohnston self-assigned this Nov 30, 2021
@averyjohnston
Copy link
Contributor

Hi, thanks for the issue. I'm able to replicate this behavior, both in Vue and React. While the fixed slot is part of ion-content, it looks like this is specifically happening when the content is inside an ion-modal. 🤔

@averyjohnston
Copy link
Contributor

I've resolved this via #24300 and the fix will be available in a future release of Ionic.

In the meantime, adding transform: translateZ(0) to the element(s) in the fixed slot will do the trick 👍

@tho-masn
Copy link
Author

tho-masn commented Dec 1, 2021

Awesome, thanks for the quick fix!

@maximilianschmid
Copy link

Great, thx for the fast response!

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 1, 2022

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 Jan 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants