Skip to content

mat-slide-toggle component's toggle() method does not emit change event #11812

Closed
@ychaikin

Description

@ychaikin

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When calling component's toggle method programmatically, change event should be emitted.

What is the current behavior?

Simply flips the boolean value of its checked property.

What are the steps to reproduce?

StackBlitz code sample with the test:
https://stackblitz.com/edit/angular-material-slide-toggle-test-qzbvad?file=app%2Fmat-slide-toggle-bug.component.spec.ts

What is the use-case or motivation for changing an existing behavior?

This would be very useful when testing behavior, but I can see how it would be useful for some programmatic toggling during regular use as well.

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

All

Is there anything else we should know?

no

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions