angular / angular/components

bug(Button): Button hover/clickable outside border & missing token

オープン
#30,573 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/button P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Is this a regression?

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

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

_No response_

### Description

When a override is added to a button, the button remains clickable and can be hovered outside the border. I found a token to override this behavior, but I can't get it to work. Additionally, I suggest improving the documentation by specifying the types of values accepted for the token.

```
@include mat.button-overrides((
filled-touch-target-display: none
))
```

https://github.com/user-attachments/assets/11989574-c581-4aff-858b-d77e2368cd3e

Also there is no option to change outline color of outlined button when hovered/focused/pressed, only for disabled state? According to m3 design it should be possible:
https://m3.material.io/components/buttons/specs#4a0c06da-0b2f-47de-a583-97e0ae80b5a5

### Reproduction

StackBlitz link: https://stackblitz.com/edit/q9bg7z8v?file=src%2Fexample%2Fbutton-overview-example-override.scss
Steps to reproduce:
1. Try to move cursor close to the button border

### Expected Behavior

Button should not be clickable or able to hover outside button border

### Actual Behavior

Button is clickable and can be focused outside border

### Environment

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/example/button-overview-example-override.scss にある StackBlitz の再現から始め、mat.button-overrides が filled-touch-target-display をどのように処理するかを調査します。hover、focus、click の領域を表示されている境界線と比較し、outlined-button のインタラクションカラーを設定できるか確認します。ヒット領域が境界線と一致し、受け入れ可能な token 値が文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, sass, typescript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。