angular / angular/components

bug MatFormFields: Force LTR in RTL page

Offen
#26,778 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/form-field P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

The current style behavior for form fields that if there is any RTL direction previous to it, it will be targeted.
since the LTR is the default case it wont be an issue to force the component to be RTL, however in RTL page you cant force LTR direction to MatFormFields.

### Reproduction

Steps to reproduce:
1. set dir rtl globally in index.html
2. set dir ltr to any form filed
https://stackblitz.com/edit/components-issue-2e8dha?file=src/app/example-component.html

### Expected Behavior

to be able to change direction of formfield

### Actual Behavior

formfield style stays rtl with direction ltr on in

### Environment

- Angular: 15
- CDK/Material: 15
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the linked StackBlitz reproduction, checking the global direction in index.html and the form field markup in src/app/example-component.html. Trace how the form field responds to global RTL and local LTR settings. Done means a form field with dir="ltr" renders LTR even when the page direction is RTL.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular
Bereich
frontend, internationalization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.