Skip to content

Commit

Permalink
fix(list,textfield): Fix TS 4.9 compliation of role property override.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 499312798
  • Loading branch information
dfreedm authored and copybara-github committed Jan 3, 2023
1 parent a6bbac5 commit c70198a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions list/lib/divider/list-divider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {ARIARole} from '../../../types/aria.js';
/** @soyCompatible */
export class ListDivider extends LitElement {
@ariaProperty // tslint:disable-line:no-new-decorators
// tslint:disable-next-line:decorator-placement
@property({type: String, attribute: 'data-role', noAccessor: true})
// @ts-ignore(b/264292293): Use `override` with TS 4.9+
role: ARIARole = 'separator';

/** @soyTemplate */
Expand Down
2 changes: 2 additions & 0 deletions list/lib/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export class List extends LitElement {
ariaActivedescendant!: string;

@ariaProperty // tslint:disable-line:no-new-decorators
// tslint:disable-next-line:decorator-placement
@property({type: String, attribute: 'data-role', noAccessor: true})
// @ts-ignore(b/264292293): Use `override` with TS 4.9+
role: ARIARole = 'list';

@property({type: String}) listId = '';
Expand Down
2 changes: 2 additions & 0 deletions list/lib/listitem/list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {ifDefined} from 'lit/directives/if-defined.js';
/** @soyCompatible */
export class ListItem extends ActionElement {
@ariaProperty // tslint:disable-line:no-new-decorators
// tslint:disable-next-line:decorator-placement
@property({type: String, attribute: 'data-role', noAccessor: true})
// @ts-ignore(b/264292293): Use `override` with TS 4.9+
role: ARIARole = 'listitem';

@ariaProperty // tslint:disable-line:no-new-decorators
Expand Down
3 changes: 3 additions & 0 deletions textfield/lib/text-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ export abstract class TextField extends LitElement {
@ariaProperty // tslint:disable-line:no-new-decorators
ariaLabelledBy!: string;

// tslint:disable:decorator-placement
@property({type: String, attribute: 'data-role', noAccessor: true})
@ariaProperty // tslint:disable-line:no-new-decorators
// @ts-ignore(b/264292293): Use `override` with TS 4.9+
role: ARIARole|null = null;
// tslint:enable:decorator-placement

// FormElement
get form() {
Expand Down

0 comments on commit c70198a

Please sign in to comment.