Closed
Description
Working on resolving a bug that MatRipple
stuck in the focus state. When on disable, sometimes the ripple cannot fade out the ripple in time. After investigation, it seems that there is opportunity when the mouseup
event is not captured before setting to disable and mat-ripple-element
is not fired correctly .
Reproduce the error
Step to reproduce
- Immediately click the icon button when move the cursor on it.
- Try couple of times if you cannot see the state stuck after you move away the cursor.
- Try more times after you reproduce it - you will see the color of the state becomes darker, since multiple
mat-ripple-element
s are not fired correctly.
Expected behavior
mat-ripple-element
should be always deleted on mouse up
Environment
Angular Material: 11.2.9
rxjs: 6.6.7
Browser: Chrome
Operating system: Mac
Fix
On disable, it should call fadeOutAll()
method to make sure all mat-ripple-element
s are fired. So I propose to have this change on the ripple disabled
variable:
set disabled(value: boolean) {
if (value) {
this.fadeOutAll();
}
this._disabled = value;
this._setupTriggerEventsIfEnabled();
}