md-checkbox: links in label do not work
When you have a link within an md-checkbox clicking on the link toggles the checkbox instead of opening the link. Example
<md-checkbox ng-model="user.AcceptedTerms">
I agree to the <a ui-sref="legal.tos">Terms of Service</a>
</md-checkbox>
I also tried to add ng-click="$event.stopPropagation()" and ng-click="$event.stopPropagation()" to the <a>. It also doesn't work if you use an href instead of ui-sref.
@epelc - please use lowerCamelCase name prefixes (@see Issue Submissions)
@ThomasBurleson Sorry about that
@epelc - No worries. You are a great contributor; hence my using your submission to set standards/precedence ;-)
@ThomasBurleson Thank you. I hope I can contribute more soon.
Note: This should be resolved when refactored approach to checkboxes/radio buttons is implemented.
Related issues: #1006 #1007
@robertmesserle I just noticed that you can tab to the links but the focus state does not seem to show on the link or the checkbox text.
what about this?
Guys, any update on this one?
click over the link doesn't work because '.md-label' has 'pointer-events: none;' css rule. my quick fix for now:
md-checkbox .md-label {
pointer-events: auto;
}
md-checkbox .md-label span {
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
When the link has target="_blank" clicking the link will check the checkbox (with the 0.10 version). I think this should not happen.
See http://plnkr.co/edit/fjXDqbi6U5p6zv9K1AKM?p=preview
+1 @Necroskillz
Any update on the fix for this anyone please?
Here is a workaround:
<md-checkbox ng-model="conditions">
I agree to the
<a onclick="window.open('legal.tos')" ng-click="$event.stopPropagation()">
Terms of Service
</a>
</md-checkbox>
(you could use $window instead of window if required)