Comments (3)
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 getComputedStyle
on the swiper-container
element to query for the direction. This requires that the correct direction is set on that element at the time that code is run.
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 swiper-container
will not inherit the correct direction
until after the slot has been added. Since this code is run before that happens, the code I mentioned above reports that swiper-container
has direction: ltr
set.
This issue also reproduces with the dum-my
component added in your sample. Your original code used ng-content
which puts the swiper-container
inside of the Shadow DOM. This is different from ion-content
which projects swiper-container
in a slot instead. By changing ng-content
to slot
in dum-my
the issue will reproduce there as well.
As for why this is the case, it has to do with how CSS inheritance is defined:
For a [DOM] tree with shadows, inheritance operates on the flattened element tree. This means that slotted elements inherit from the slot theyโre assigned to, rather than directly from their light tree parent.
This means that swiper-container
should inherit from the slot
element inside of ion-content
not ion-content
itself. Since slot
has not been added yet, swiper-container
does not have anything to inherit from, so it uses the default value for direction
which is ltr
.
Here's an example of this problem outside of Ionic: https://codepen.io/liamdebeasi/pen/rNbPKxN?editors=1010 I also checked the color
property too to demonstrate that this issue is not specific to the direction
property.
I am going to close this, but let me know if you have any questions.
from ionic-framework.
Does this issue reproduce without Swiper? If it only reproduces with Swiper, then you should file a repo on the Swiper repo instead.
from ionic-framework.
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
from ionic-framework.
Related Issues (20)
- @ionic/react-router not compatible with latest version of ERROR in ./node_modules/@ionic/react-router/dist/index.js 890:18-28 export 'withRouter' (imported as 'withRouter') was not found in 'react-router-dom HOT 3
- [TRAINING] bug: button retained in memory after removed from DOM
- bug: scroll element not reachable in CI HOT 1
- bug: occasional page animation issues HOT 2
- bug: ion-item + ion-checkbox on 'start' slot not respect width on v8 (v7 was ok) HOT 1
- feat: ion-datetime add calendar day highlight customclass HOT 1
- bug: inconsistency in the style of highlighted dates HOT 1
- bug: Cannot change display mode of the component dynamically HOT 1
- bug: angular standalone modal controller from compoent class getting error HOT 1
- bug: ion-radio labelPlacement doesn't apply class radio-label-placement-end HOT 2
- bug: ion-radio does not keep checked-state after updating the underlaying object HOT 2
- bug: input signal effects are not run when attaching a directive to an IonButton HOT 2
- bug: ion-input-password-toggle causes label to float even when input is empty HOT 1
- iPhon
- bug: footer with collapse property set to fade does not render properly on dynamic content
- bug: Android HTTP post requests HOT 3
- I
- feat: Ionic V8: Ion-Input Label Size CSS Custom Properties
- bug: Reorder Group displays items in incorrect order after reordering and updating items
- feat: ion-picker mouse scroll control
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-framework.