Closed
Description
Reproduction
Using Chrome, see the following StackBlitz: https://stackblitz.com/edit/angular-1ztoyy
Steps to reproduce:
- Upon page load, note that the mat-slide-toggle properly responds to click events by toggling itself.
- After 5 seconds, the page is programmatically selecting text in a nearby textbox. (You can also reproduce the issue by manually selecting the text.)
- Without clicking anywhere else, try the mat-slide-toggle again, and note that it no longer toggles upon click. (The ripple effect does appear, indicating that it knows it has been clicked. Interestingly, double-click does work.)
- Clicking elsewhere on the form restores the expected behavior (presumably because this causes the selected text to be de-selected).
Expected Behavior
The mat-slide-toggle control should toggle its state when clicked.
Actual Behavior
After selecting text in another field, the mat-slide-toggle no longer toggles its state when clicked.
Environment
- Angular: 9.0.0-rc.9 (This does not appear to be an issue in Angular 8 / Material 8)
- CDK/Material: Material 9.0.0-rc.8
- Browser(s): Chrome 79.0.3945.130 (64-bit) (issue does not appear to occur in Edge or Firefox)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 x64