From c70198a5670bc372140315cec20cbca0ed576115 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 3 Jan 2023 14:09:38 -0800 Subject: [PATCH] fix(list,textfield): Fix TS 4.9 compliation of role property override. PiperOrigin-RevId: 499312798 --- list/lib/divider/list-divider.ts | 2 ++ list/lib/list.ts | 2 ++ list/lib/listitem/list-item.ts | 2 ++ textfield/lib/text-field.ts | 3 +++ 4 files changed, 9 insertions(+) diff --git a/list/lib/divider/list-divider.ts b/list/lib/divider/list-divider.ts index cc31f9e589..298fb4abb2 100644 --- a/list/lib/divider/list-divider.ts +++ b/list/lib/divider/list-divider.ts @@ -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 */ diff --git a/list/lib/list.ts b/list/lib/list.ts index 805bccdf49..5fd993b81b 100644 --- a/list/lib/list.ts +++ b/list/lib/list.ts @@ -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 = ''; diff --git a/list/lib/listitem/list-item.ts b/list/lib/listitem/list-item.ts index 36afa41fbb..4b0ccd1520 100644 --- a/list/lib/listitem/list-item.ts +++ b/list/lib/listitem/list-item.ts @@ -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 diff --git a/textfield/lib/text-field.ts b/textfield/lib/text-field.ts index 5974531b2d..003d46dbff 100644 --- a/textfield/lib/text-field.ts +++ b/textfield/lib/text-field.ts @@ -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() {