Skip to content

Commit

Permalink
feat(list): Added aria-checked attribute support to list item.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 468119465
  • Loading branch information
material-web-copybara authored and copybara-github committed Aug 17, 2022
1 parent dc8045e commit 2c06c2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions list/lib/listitem/list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export class ListItem extends ActionElement {
@property({type: String, attribute: 'data-aria-selected', noAccessor: true})
override ariaSelected!: 'true'|'false';

@ariaProperty // tslint:disable-line:no-new-decorators
@property({type: String, attribute: 'data-aria-checked', noAccessor: true})
override ariaChecked!: 'true'|'false';

@property({type: String}) supportingText = '';
@property({type: String}) multiLineSupportingText = '';
@property({type: String}) trailingSupportingText = '';
Expand All @@ -44,6 +48,7 @@ export class ListItem extends ActionElement {
tabindex=${this.itemTabIndex}
role=${this.role}
aria-selected=${ifDefined(this.ariaSelected || undefined)}
aria-checked=${ifDefined(this.ariaChecked || undefined)}
data-query-md3-list-item
class="md3-list-item ${classMap(this.getRenderClasses())}"
@pointerdown=${this.handlePointerDown}
Expand Down

0 comments on commit 2c06c2e

Please sign in to comment.