From 5e2cb55c1ab19a7add8a611a060499ab6f9804fe Mon Sep 17 00:00:00 2001 From: Matt Driscoll Date: Mon, 25 Nov 2024 11:16:31 -0800 Subject: [PATCH] fix(dialog): fix error when initially opened. #10860 --- .../calcite-components/src/components/dialog/dialog.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/calcite-components/src/components/dialog/dialog.tsx b/packages/calcite-components/src/components/dialog/dialog.tsx index 71665087c9c..f4da3a62dba 100644 --- a/packages/calcite-components/src/components/dialog/dialog.tsx +++ b/packages/calcite-components/src/components/dialog/dialog.tsx @@ -401,7 +401,13 @@ export class Dialog } private handleOpenedChange(value: boolean): void { - this.transitionEl.classList.toggle(CSS.openingActive, value); + const { transitionEl } = this; + + if (!transitionEl) { + return; + } + + transitionEl.classList.toggle(CSS.openingActive, value); onToggleOpenCloseComponent(this); }