Skip to content

mat-slide-toggle unexpected animation in certain conditions #14488

@BartoszWasiluk

Description

@BartoszWasiluk

What is the expected behavior?

MatSlideToggle shouldn't display an animation after rendering with given state

What is the current behavior?

MatSlideToggle display a slide animation from off -> on in certain conditions

What are the steps to reproduce?

https://stackblitz.com/edit/angular-pzaey9?file=animation-bug.component.ts
Click EDIT -> then click the "SAVE WITHOUT BUG" button -> it's expected bahviour
Click EDIT -> then click the "SAVE WITH BUG" button -> unexpected animation

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular version: 7.1.3
Material Version: 7.1.1
OS: Windows10 / Chrome 70.0.3538.110 (64-bit) (it works well on Firefox, Edge, IE11)
TS: ~3.1.1

Is there anything else we should know?

Making one of the following fixes this behaviour:

  • removing animation from Component declaration (I need it in my component)
  • moving button above SlideToggle
  • setting additional *ngIf on SlideToggle

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/slide-toggle

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions