From d501dddfd541a72ef50aff667cd06644801b1e90 Mon Sep 17 00:00:00 2001 From: vdegenne Date: Tue, 28 Nov 2023 10:22:08 +0100 Subject: [PATCH] fix(chip): disabled attribute prevents click event. --- chips/internal/_shared.scss | 4 ++++ chips/internal/chip.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/chips/internal/_shared.scss b/chips/internal/_shared.scss index fd29303cb4..1f278040d7 100644 --- a/chips/internal/_shared.scss +++ b/chips/internal/_shared.scss @@ -37,6 +37,10 @@ margin: max(0px, (48px - var(--_container-height)) / 2) 0; } + :host([disabled]) { + pointer-events: none; + } + md-focus-ring { @include focus-ring.theme( ( diff --git a/chips/internal/chip.ts b/chips/internal/chip.ts index 0b94afd156..e6fe46b137 100644 --- a/chips/internal/chip.ts +++ b/chips/internal/chip.ts @@ -34,7 +34,7 @@ export abstract class Chip extends LitElement { * * Disabled chips are not focusable, unless `always-focusable` is set. */ - @property({type: Boolean}) disabled = false; + @property({type: Boolean, reflect: true}) disabled = false; /** * When true, allow disabled chips to be focused with arrow keys.