Commit 6cf2dd2
chore: fix mdc-checkbox not working with ivy
Fixes that the `mdc-checkbox` prototype does not work properly with
Ivy as there are component inputs which are commonly set programmatically
but do not mark the checkbox as dirty.
This surfaced in one of the checkbox tests because with Ivy, calling `markForCheck`
from within the `ngAfterViewInit` lifecycle hook has basically no effect while View
Engine keeps the component dirty.
This caused a checkbox test failure because the test just assigned the
value of the `MatCheckbox#checked` property and called `detectChanges`
afterwards. Since the component is not marked as dirty due to the aforementioned
Ivy difference, the component will not be checked and updated. In order to fix
the test we just mark the component for check in the input setters (similarly to
how we do it for other inputs of `MatCheckbox` such as `disabled`).1 parent 9bb09eb commit 6cf2dd2
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
0 commit comments