-
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: :host selector on element combined with rtl mixins does not create the proper selector #25285
Comments
Thanks for the issue. I can reproduce this behavior. We incorrectly assume that if the selector contains ionic-framework/core/src/themes/ionic.functions.string.scss Lines 141 to 143 in 454eff6
As a result, using a selector such as |
Some clarified steps to reproduce:
<ion-img src="https://picsum.photos/200/300"></ion-img>
<div class="test-element">my test element</div>
@import "../../themes/ionic.globals";
...
:host {
width: 300px;
height: 300px;
}
:host .test-element {
@include position(null, null, null, 50px);
position: relative;
background: red;
}
|
Issue URL: resolves #26103, resolves #25285 --------- <!-- Please refer to our contributing documentation for any questions on submitting a pull request, or let us know here if you need any help: https://ionicframework.com/docs/building/contributing --> <!-- Some docs updates need to be made in the `ionic-docs` repo, in a separate PR. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation for details. --> <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Options in `item-sliding` will not display when using RTL with Firefox and Safari. <!-- Issues are required for both bug fixes and features. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Issue was coming from `:host-context`. Firefox would keep [removing the entire](https://www.w3.org/TR/selectors-3/#grouping) compiled style when using this unsupported style. This would led to the RTL styles to not being applied to the component. - Split the CSS group from `add-root-selector()` - Added comments to make it easier to navigate through `add-root-selector()` - Added `:dir()` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Co-authored-by: brandyscarney <brandyscarney@users.noreply.github.com> - Updating `add-root-selector()` would also fix another [issue](#25285) unintentionally --------- Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Thank you for the issue! The fix has been applied through PR #27203. |
The fix has been released in v7.0.6. |
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
Current Behavior
With the following CSS:
When using the
rtl
mixin so, alsoadd-root-selector
it translates the selector as:So part of it is lost.
Expected Behavior
With the following CSS:
When using the rtl mixin so, also add-root-selector it translates the selector as:
Maintaining the whole selector.
Steps to Reproduce
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.19.0 (/Users/pau/.nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.9.2
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.1, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 22 other plugins)
Utility:
cordova-res (update available: 0.15.4) : 0.15.3
native-run (update available: 1.5.0) : 1.4.0
System:
ios-sim : 8.0.2
NodeJS : v16.14.2 (/Users/pau/.nvm/versions/node/v16.14.2/bin/node)
npm : 8.5.0
OS : macOS Monterey
Xcode : Xcode 13.3 Build version 13E113
Additional Information
No response
The text was updated successfully, but these errors were encountered: