-
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
MdCheckBox is behaving different to native checkbox #575
Comments
Interesting also, check this out http://plnkr.co/edit/nDWK7EmmCBgMkHIKRIg7?p=preview the checkbox click function is called twice, why so? |
@sendilkumarn I have experienced the double fires since the last release (alpha 5). |
@jelbourn is this correct, I will submit a PR if so Add a method for click event in checkbox. we can re use the checkbox change method itself. This kinda solves problem. |
It seems that the issue here isn't a double-firing |
Yeah agree to that. But clicks firing two times is also an issue. Check #613 Aim is to prevent double firing of click event |
one more weird behavior with respect to checkbox. Is this even correct or am I missing out anything. click / change one - just printing ng model value => returns true / false is this expected? |
I've set up a simple plunkr to demonstrate the duplicate events by logging to the console - http://embed.plnkr.co/3IGFLbFEpvVldtOOosAq/ On first click one change and two click events are fired. I'm having to set 10ms timeouts on all material inputs before reading model values from them - it would be great if they could update in the current digest cycle, but I presume the delays are there to avoid change after checked warnings. |
I also have this issue where I'm getting an erroneous (changed) event to fire when the [ngModel] causes the checkbox to change from checked to unchecked. This behavior does not happen for md-input. |
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: Bug
Links for both native and MdCheckBox version below
What is the expected behavior?
Native Checkbox version
http://plnkr.co/edit/cZbFWOlCeZuj7YdUczPm?p=preview
What is the current behavior?
This is with MdCheckBox
http://plnkr.co/edit/FFpqdNhQfvbUynbPE1ZD?p=preview
What are the steps to reproduce?
Native version has the desired behaviour that is, unselect the top most checkbox if one of the below one is unchecked. But with MdCheckBox the change to reset top most checkbox triggers on change event, which is resetting all the below checkboxes.
I don't know which one is correct behaviour or both are correct.
Any help to get the MdCheckBox version working is appreciated.
What is the use-case or motivation for changing an existing behavior?
Get MdCheckBox behave as close to native checkbox as possible
Which versions of Angular, Material, OS, browsers are affected?
alpha 5
Is there anything else we should know?
Bo
The text was updated successfully, but these errors were encountered: