From 8a92649b5182e3c36a7ffc4d94311a4bd366293a Mon Sep 17 00:00:00 2001 From: ariellalgilmore Date: Tue, 5 Dec 2023 10:15:57 -0800 Subject: [PATCH] fix(accordion): ts errors --- .../src/components/accordion/accordion-item.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/carbon-web-components/src/components/accordion/accordion-item.ts b/packages/carbon-web-components/src/components/accordion/accordion-item.ts index 2f2288c09de..20117596d41 100644 --- a/packages/carbon-web-components/src/components/accordion/accordion-item.ts +++ b/packages/carbon-web-components/src/components/accordion/accordion-item.ts @@ -107,14 +107,14 @@ class CDSAccordionItem extends FocusMixin(LitElement) { ) ); } - const content = this.shadowRoot.querySelector(`.${prefix}--accordion__wrapper`); - + const content = this.shadowRoot!.querySelector(`.${prefix}--accordion__wrapper`) as HTMLElement; + if (this.open) { // accordion opens - content.style.maxBlockSize = content.scrollHeight + 15 + 'px'; + content!.style.maxBlockSize = content!.scrollHeight + 15 + 'px'; } else { // accordion closes - content.style.maxBlockSize = ''; + content!.style.maxBlockSize = ''; } }