Repository navigation
Conversation
The form field styles used `[dir=rtl]` selectors, which match any ancestor with `dir="rtl"`. This meant that a form field with `dir="ltr"` inside an RTL page still got the RTL styles: the outline lost its leading border and the label, padding and native select arrow were placed for RTL. These changes switch the styles to logical properties, so they follow the direction of the form field itself. `transform-origin` and `clip-path` have no logical equivalents, so those two rules use `:dir(rtl)`, which also resolves against the closest element with a `dir` attribute. Fixes angular#26778.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The form field styles used
[dir='rtl']selectors, which match any ancestor withdir="rtl". This meant that a form field withdir="ltr"inside an RTL page still got the RTL styles: the outline lost its leading border and the label, padding and native select arrow were placed for RTL.These changes switch the styles to logical properties, so they follow the direction of the form field itself.
transform-originandclip-pathhave no logical equivalents, so those two rules use:dir(rtl), which also resolves against the closest element with adirattribute.Measured in an Angular 22.2 / Material 22.2.6 app (Chromium and Firefox), label offset from the start edge of a
dir="ltr"field inside adir="rtl"page:Fields in a plain RTL page measure the same before and after.
Fixes #26778.