From 751638ac64a1b9b0980377b96b7bd4ccff6306fa Mon Sep 17 00:00:00 2001 From: "Nichols, Kieran" Date: Mon, 21 Oct 2024 10:16:20 -0400 Subject: [PATCH] fix(base-button): fixed a bug where calling `.click()` on a button before it's connected would result in an exception --- src/lib/button/base/base-button-adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/button/base/base-button-adapter.ts b/src/lib/button/base/base-button-adapter.ts index bd4185b12..f8353114f 100644 --- a/src/lib/button/base/base-button-adapter.ts +++ b/src/lib/button/base/base-button-adapter.ts @@ -225,7 +225,7 @@ export abstract class BaseButtonAdapter extends BaseAdapt } public animateStateLayer(): void { - if (this._stateLayerElement.disabled) { + if (this._stateLayerElement.disabled || !this._stateLayerElement.isConnected) { return; } this._stateLayerElement?.playAnimation();