angular / angular/components

bug(material/slide-toggle): Animation duration in M3 should be 300ms

Open
#28,916 1 comment 2 reactions 0 assignees View on GitHub
area: material/slide-toggle M3 P3
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

The Slide toggle animation with an M3 theme uses the same duration and timing function as the M2 slide toggle. For the M3 switch this looks jarring and unfitting.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-andwku?file=src%2Fmain.ts
Steps to reproduce:
1. Look at the toggle animation
2. Compare with the toggle animation used in Material Web: https://material-web.dev/components/switch/stories/

### Expected Behavior

The slide toggle animation should not be jarring when using an M3 theme.

### Actual Behavior

The slide toggle animation uses the short animation duration from M2 and appears jarring.

### Environment

- Angular: 17.3.5
- CDK/Material: 17.3.5

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction at src/main.ts and compare the M3 slide-toggle animation with the Material Web switch behavior. Trace the Angular Material slide-toggle implementation to identify the M3 animation duration and verify that the completed behavior uses a 300ms duration without the jarring transition.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.