Skip to content

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

Closed

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

Activity

  1. changed the title [-]mat-slide-toggle component's `toggle` method does not emit `change` event[/-] [+]mat-slide-toggle component's toggle() method does not emit change event[/+] on Jun 17, 2018
  2. ychaikin commented on Jun 17, 2018

    @ychaikin
    Author

    If this is indeed a bug and not "as intended", I can probably help out and put together a PR to fix.

  3. self-assigned this
    on Jun 19, 2018
  4. added
    P3
    on Jun 19, 2018
  5. added 3 commits that reference this issue on Jun 19, 2018
    4102f25
    41aa96b
    ba4fe2f
  6. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions