-
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
feat(checkbox): adds invisible input element to leverage built-in functionality #415
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
<div class="md-checkbox-layout"> | ||
<label class="md-checkbox-layout"> | ||
<div class="md-checkbox-inner-container"> | ||
<input class="md-checkbox-input" type="checkbox" | ||
[id]="inputId" | ||
[checked]="checked" | ||
[disabled]="disabled" | ||
[name]="name" | ||
[tabIndex]="tabindex" | ||
[indeterminate]="indeterminate" | ||
[attr.aria-label]="ariaLabel" | ||
[attr.aria-labelledby]="ariaLabelledby" | ||
(focus)="onInputFocus()" | ||
(blur)="onInputBlur()" | ||
(change)="onInteractionEvent($event)"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears so |
||
<div class="md-ink-ripple"></div> | ||
<div class="md-checkbox-frame"></div> | ||
<div class="md-checkbox-background"> | ||
<svg version="1.1" | ||
|
@@ -16,7 +29,7 @@ | |
<div class="md-checkbox-mixedmark"></div> | ||
</div> | ||
</div> | ||
<label [id]="labelId"> | ||
<span class="md-checkbox-label"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't that generates problems with clicks, screen readers and custom label? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No - the outer wrapper is a label which automatically handles this properly since this relies on native behavior. |
||
<ng-content></ng-content> | ||
</label> | ||
</div> | ||
</span> | ||
</label> |
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.
Also it looks like, the
name
property doesn't exist as an input / property.