angular / angular/components

bug(MatButton): FAB with disabled state using alpha on background collisions

Ouverte
#28,291 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area: material/button 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

Screenshot 2023-12-15 at 2 33 55 PM

Because the disabled state background color is defined with alpha, FAB collide with page contents when disabled. There's no guideline anywhere stating that FAB should never get disabled, and a disabled FAB is even part of the documentation.

FAB stands for Floating Action Button according to https://m3.material.io/components/floating-action-button/overview so it should be assumed most uses will be with absolute or fixed positioning.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/4rnhsm?file=src%2Findex.html,src%2Fexample%2Fbutton-overview-example.html,src%2Fexample%2Fbutton-overview-example.css
Steps to reproduce:
1. Have a FAB button
2. Make it disabled

### Expected Behavior

The button doesn't get visually mixed with the page contents. One potential solution would be to make the disabled state not use alpha.

### Actual Behavior

Page contents as partially visible background on the button decrease its readability.

### Environment

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz, en particulier src/index.html, src/example/button-overview-example.html et src/example/button-overview-example.css, et confirmez la collision d’arrière-plan du FAB désactivé. Suivez le style MatButton du FAB désactivé à partir de la reproduction et vérifiez que le contenu du FAB désactivé reste lisible par-dessus le contenu de la page sans dépendre d’une restriction de positionnement non documentée.

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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