angular / angular/components

bug(MatSlider): MatSliderThumb stays active after drag ending

オープン
#29,767 コメント 3 件 リアクション 4 件 担当者 0 名 GitHub で見る
area: material/slider P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
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

When you start dragging slider **MatSliderThumb** became active. Sometimes, it doesn't loose active state, when you ending dragging. It stays active even after click outside. Only way to 'release' it - drag it again.

Within this issue **dragStart** event is fired, but **dragEnd** not. Variable **_isActive** of MatSliderThumb stays true.
That leads to inconsistence of MatSliderThumb view (it looks as active all time) and **makes setting it's value programmatically impossible** (if you are trying to set Value from component).

Bug is not stable but can be easily reproduced at official doc examples.
Mostly occur, when dragging ends little lower than MatSliderThumb position.

https://github.com/user-attachments/assets/77b99e5e-5bb4-4a47-9442-d7a3fbd5e423

### Reproduction

StackBlitz link: https://stackblitz.com/edit/ikftbm?file=src%2Fexample%2Fslider-overview-example.html
Steps to reproduce:
1. Drag slider a little
2. Release on bottom side

### Expected Behavior

dragEnd should be fired each time when user actually ending it.

### Actual Behavior

Sometimes dragEnd event is not fired after actual dragging end.

### Environment

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

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

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

調査の方向性

リンクされた StackBlitz の例で示されている MatSliderThumb のドラッグ処理から始め、Chrome で少しドラッグして下側で離すことで不具合を再現します。ポインターを離す際の dragStart イベントと dragEnd イベント、および _isActive の状態を追跡します。完了条件は、完了したすべてのドラッグで dragEnd が発生し、thumb がアクティブなままにならず、その後にプログラムによる値の変更が機能することです。

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

評価

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

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

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