-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slide-toggle fires change event on load #709
Comments
I just confirmed that with |
@devversion checkbox and radio use an |
… multiple times * Adds a test which confirms, that the slide-toggle isn't firing the (change) event multiple times. Closes angular#709
@jelbourn We already chatted about on the initial PR, but this bug is not noticeable in the I've created a PR, which adds a test, which confirms that the |
@devversion did you see the Plunkr I posted? The change event is definitely triggered on load in the example. I'm not referring to triggering the event "multiple" times, but rather triggering the event without user or program interaction. |
@rafikk I definitely see the issue. But the Plunker is running on Alpha.5 instead of |
Closing based on @devversion's assessment. |
Whoops, we mistook this for a different issue. |
* test(slide-toggle): add test to confirm that change event don't fires multiple times * Adds a test which confirms, that the slide-toggle isn't firing the (change) event multiple times. Closes #709 * update(): prevent change event to be fired at initialization * update(): remove internal annotation
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Slide-toggle triggers change event on initialization if initial value of "checked" is true.
What is the expected behavior?
The event should only be fired in response to an interaction.
What is the current behavior?
The component fires the event before any user action has occurred.
What are the steps to reproduce?
Plunkr to reproduce here: http://plnkr.co/KCZtmelCWK6JKj0FDlh6
What is the use-case or motivation for changing an existing behavior?
If the app triggers an expensive operation, e.g. an API request, in response to the change event, this results in misfired updates and slows load time.
Which versions of Angular, Material, OS, browsers are affected?
All.
Is there anything else we should know?
I don't think so. :)
The text was updated successfully, but these errors were encountered: