angular / angular/components

bug MatFormFields: Force LTR in RTL page

Ouverte
#26,778 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area: material/form-field P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular
Domaine
frontend, internationalization
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.