Commit 8d9bbbf
fix(checkbox): margin for empty checkboxes incorrectly added (#4730)
* fix(checkbox): margin for empty checkboxes incorrectly added
With #2121 the margin will be removed for checkboxes that don't have any label set.
A problem is that the Checkbox uses the OnPush change detection strategy and therefore the checkbox is not able to detect any delayed / async label change.
This means that checkboxes that set their label from an async binding will not have any margin until the users clicks on the checkbox.
Using the `cdkObserveContent` seems to be an elegant approach when using the OnPush strategy.
The `:empty` CSS selector would be more elegant but it's very sensitive about whitespaces and therefore it doesn't work properly.
Fixes #4720
* Updates1 parent 436858e commit 8d9bbbf
File tree
4 files changed
+62
-22
lines changed- src/lib/checkbox
4 files changed
+62
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
769 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
770 | 771 | | |
771 | | - | |
| 772 | + | |
772 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
773 | 784 | | |
774 | | - | |
775 | | - | |
776 | 785 | | |
777 | | - | |
778 | | - | |
779 | | - | |
| 786 | + | |
| 787 | + | |
780 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
781 | 819 | | |
782 | 820 | | |
783 | 821 | | |
| |||
888 | 926 | | |
889 | 927 | | |
890 | 928 | | |
891 | | - | |
| 929 | + | |
892 | 930 | | |
893 | | - | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 164 | | |
173 | 165 | | |
174 | 166 | | |
| |||
251 | 243 | | |
252 | 244 | | |
253 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments