bug(MatButton): FAB with disabled state using alpha on background collisions
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 91
描述
### 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
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
贡献指南
调研方向
从 StackBlitz 复现开始,尤其检查 src/index.html、src/example/button-overview-example.html 和 src/example/button-overview-example.css,并确认已禁用 FAB 的背景冲突。追踪复现中的已禁用 FAB 的 MatButton 样式,并验证已禁用 FAB 的内容在页面内容上方仍保持可读,而无需依赖未记录的定位限制。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, css, typescript
- 领域
- design, frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100