Skip to content

Commit

Permalink
fix(list)!: change compound attribute names to kebab-case
Browse files Browse the repository at this point in the history
BREAKING_CHANGE: Attributes `listtabindex`, `supportingtext`, `multilinesupportingtext`, `trailingsupportingtext`, and `itemtabindex` have been renamed to `list-tabindex`, `supporting-text`, `multi-line-supporting-text`, `trailing-supporting-text`, and `item-tabindex`.
PiperOrigin-RevId: 542629274
  • Loading branch information
AndrewJakubowicz authored and copybara-github committed Jun 22, 2023
1 parent 2937aef commit 0e3fe72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion list/lib/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class List extends LitElement {
/**
* The tabindex of the underlying list.
*/
@property({type: Number}) listTabIndex = 0;
@property({type: Number, attribute: 'list-tabindex'}) listTabIndex = 0;

@query('.md3-list') listRoot!: HTMLElement|null;

Expand Down
10 changes: 6 additions & 4 deletions list/lib/listitem/list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,20 @@ export class ListItemEl extends LitElement implements ListItem {
* `multiLineSupportingText` to `true` to support multiple lines in the
* supporting text.
*/
@property() supportingText = '';
@property({attribute: 'supporting-text'}) supportingText = '';

/**
* Modifies `supportingText` to support multiple lines.
*/
@property({type: Boolean}) multiLineSupportingText = false;
@property({type: Boolean, attribute: 'multi-line-supporting-text'})
multiLineSupportingText = false;

/**
* The supporting text placed at the end of the item. Overridden by elements
* slotted into the `end` slot.
*/
@property() trailingSupportingText = '';
@property({attribute: 'trailing-supporting-text'})
trailingSupportingText = '';

/**
* Disables the item and makes it non-selectable and non-interactive.
Expand All @@ -70,7 +72,7 @@ export class ListItemEl extends LitElement implements ListItem {
* __NOTE:__ this is overridden by the keyboard behavior of `md-list` and by
* setting `selected`.
*/
@property({type: Number}) itemTabIndex = -1;
@property({type: Number, attribute: 'item-tabindex'}) itemTabIndex = -1;

/**
* Whether or not the element is actively being interacted with by md-list.
Expand Down

0 comments on commit 0e3fe72

Please sign in to comment.