-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(checkbox): margin for empty checkboxes incorrectly added #4730
fix(checkbox): margin for empty checkboxes incorrectly added #4730
Conversation
It makes me generally unhappy that even something as simple as checkbox has to have a |
b1c66cc
to
6dfd6cc
Compare
@jelbourn Reworked it a bit more. Yeah I'm not too happy with the solution either. |
With angular#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 angular#4720
6dfd6cc
to
0bc14f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this approach doesn't bother me too much now with the markForCheck
* Removes the side-margin of the actual indicator of the slide-toggle if the user label is empty (similar as in angular#4730) Fixes angular#6868
* Removes the side-margin of the actual indicator of the slide-toggle if the user label is empty (similar as in angular#4730) Fixes angular#6868
* Removes the side-margin of the actual indicator of the slide-toggle if the user label is empty (similar as in angular#4730) Fixes angular#6868
…ngular#6881) * Removes the side-margin of the actual indicator of the slide-toggle if the user label is empty (similar as in angular#4730) Fixes angular#6868
is there any workaround now for ^5.1.0 ? |
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. |
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