Description
Bug, feature request, or proposal:
Hookup a MdCheckbox to a FormControl.
disable()
, try to click check, and enable()
the form control.
Checkbox appears enabled but cannot be focused or checked/un-checked.
What is the expected behavior?
Checkbox should be able to be disabled/enabled using FormControl API and user interacting with disabled checkbox should not break it.
What is the current behavior?
- checkbox works fine initially
disable()
- Try clicking checkbox. First click causes ripple effect on check. More clicks do nothing
enable()
- style changes to primary color, but cannot be clicked. Also, cannot be tab-focused
Sometimes I see:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.
This seems to depend on whether you toggled the checkbox before disabling it.
What are the steps to reproduce?
https://github.com/arlowhite/material2/tree/checkbox-control-disable-bug
npm run demo-app
Go to Input
Scroll to Checkbox BUG
Which versions of Angular, Material, OS, browsers are affected?
angular2 master 9d719c5
Ran npm update
in material2 project April 11th
Angular 4.0.1
Affects Chrome and Firefox; haven't tried others.