Skip to content
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

Click indeterminate checkbox on IE doesn't trigger toggle event #3145

Closed
tinayuangao opened this issue Feb 16, 2017 · 1 comment · Fixed by #3146
Closed

Click indeterminate checkbox on IE doesn't trigger toggle event #3145

tinayuangao opened this issue Feb 16, 2017 · 1 comment · Fixed by #3146
Assignees

Comments

@tinayuangao
Copy link
Contributor

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When the checkbox is indeterminate state, clicking on the checkbox should trigger toggle event and change the checkbox's checked status.

What is the current behavior?

The first click doesn't work. User need to click on the checkbox twice to trigger toggle.

What are the steps to reproduce?

Visit material2-dev.firebaseapp.com
Click 'Toggle Indeterminate'
Click on the checkbox (the checked value should change from Maybe! to Yes!, but it didn't)
Click on the cehckbox again (checked became Yes!)

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd

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

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

IE on Surface

Is there anything else we should know?

@tinayuangao tinayuangao self-assigned this Feb 16, 2017
@kara kara closed this as completed in #3146 Mar 1, 2017
DanLatimer pushed a commit to DanLatimer/ngx-treeview that referenced this issue Apr 24, 2018
IE handles indeterminate checkboxes "differently", it doesn't fire an
onChange event when a checkbox goes from indeterminate to a determinate
state.

This issue is well documented on the jquery github issue:
jquery/jquery#1698

The generally accepted solution is to use the onClick event instead of the
onChange event. You can see this solution implemented in the google's angular
material design library in their github link here:

angular/components#3145

I applied a similar approach to normalize the events we listen to for the
indeterminate all checkbox and commented why those things are done in the
code so this issue won't regress.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant