bug(slide-toggle): no remaining focus if clicked on non active toggle
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### 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
if a non focused toggle is clicked, there is no remaining focus - bad if keyboard control is used afterwards.
However if the label is clicked instead, the remaining focus works.

### Reproduction
Steps to reproduce:
1. https://material.angular.io/components/slide-toggle/overview
2. click on not focused toggle vs click on not focused label
### Expected Behavior
remaining focus should appear on click on a non focused toggle
### Actual Behavior
no remaining focus on click on a not already focused toggle
### Environment
- Angular: 15.1.1
- CDK/Material: 15.1.1
- Browser(s): all
- Operating System (e.g. Windows, macOS, Ubuntu): all
Contributor guide
Research direction
Reproduce the behavior at the slide-toggle overview URL by comparing a click on an unfocused toggle with a click on its label. Trace the slide-toggle focus handling and verify that clicking a non-focused toggle leaves visible keyboard focus, while preserving the existing label behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100