angular / angular/components

bug(mat-form-field): suffix element style should reflect input disabled state

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

Description

### Reproduction

[Open this StackBlitz](https://stackblitz.com/edit/components-issue-8gvvrn?file=src/app/example-component.html) and toggle the Disabled state with the checkbox.

### Expected Behavior

Per [the Text Field spec](https://material.io/components/text-fields#outlined-text-field), under "Outlined text field with suffix text", a suffix in a disabled text field should use the same font (weight / color / opacity) as the wrapped input element.

![image](https://user-images.githubusercontent.com/943160/118151415-e2f4bb80-b413-11eb-9538-445775e22e6c.png)

(In the image from the spec, "55" is the input text and "/100" is the suffix.)

### Actual Behavior

The input text is light gray, to indicate that the input is disabled, but the suffix styling does not change, so it doesn't match the input text.

### Environment

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

### Note

I also see that in all the suffix examples where the input is *not* disabled, the suffix is styled slightly lighter than the input text. As you can see in the StackBlitz, the default suffix is exactly the same as the input text. The spec doesn't explicitly require this, as far as I can see, so maybe it's just a suggestion?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Utilisez la reproduction StackBlitz liée, en commençant par src/app/example-component.html, et basculez la case à cocher pour comparer l’input désactivé et le suffixe. Suivez le style du suffixe de mat-form-field et vérifiez que le suffixe correspond à l’épaisseur de police, à la couleur et à l’opacité de l’input désactivé, tout en préservant le comportement lorsqu’il n’est pas désactivé.

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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