-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: swiper inside ion-content not recognizing dir="rtl" when rendered dynamically #29368
Comments
Does this issue reproduce without Swiper? If it only reproduces with Swiper, then you should file a repo on the Swiper repo instead. |
Yes and no, this is swiper specific but it only happens when I put the swiper in ionic. I suspect it's actually some edge case interaction between ionic and the swiper but I created an issue with them as you asked nolimits4web/swiper#7483 I was a bit hesitant to create a new bug there as I created a feature request asking for this exact thing a few days ago and got closed without any conversation with "we already do this" nolimits4web/swiper#7479 |
Thanks for the additional information. I am able to reproduce this, but this does not appear to be an Ionic bug. The main issue here is that Swiper calls This code is run after the ancestor's Shadow DOM has been created, but before the slot has been added. In Chrome, this means that This issue also reproduces with the As for why this is the case, it has to do with how CSS inheritance is defined:
This means that Here's an example of this problem outside of Ionic: https://codepen.io/liamdebeasi/pen/rNbPKxN?editors=1010 I also checked the I am going to close this, but let me know if you have any questions. |
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. |
Prerequisites
Ionic Framework Version
v7.x, v8.x
Current Behavior
When placing a swiperjs.com swiper inside an ion-content (and rendering it with a delay) the swiper doesn't recognize the surrounding dir="rtl". Only happens with ion-content.
I'm not sure if this is a swiperjs problem or an ionic problem.
Expected Behavior
rtl should propagate through ion-content regardless of when the component is rendered.
Steps to Reproduce
See linked stackblitz, first swiper works on clean page load but breaks after stackblitz livereload, second swiper doesn't work at all, 3rd and 4th work.
Code Reproduction URL
https://stackblitz.com/edit/angular-ywh4p1-vza2cj?file=src%2Fapp%2Fapp.component.html
Ionic Info
@ionic/angular: 8.0.0
@ionic/core: 8.0.0
also present in at least 7.6.2 or earlier.
Additional Information
No response
The text was updated successfully, but these errors were encountered: