diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index c37c7ad748..ce82d41c07 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -18,6 +18,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Fixed a bug in `` where when it showed it would cause a layout shift. [#1967] - Fixed a bug in `` that allowed unwanted text properties to leak in [#1947] - Fixed a bug in `` classes [#1974] +- Fixed a bug in `` that may throw errors on `disconnectedCallback` in test environments [#1985] ## 2.15.0 diff --git a/src/components/textarea/textarea.component.ts b/src/components/textarea/textarea.component.ts index f4c6e0f43a..d0dd8d5dda 100644 --- a/src/components/textarea/textarea.component.ts +++ b/src/components/textarea/textarea.component.ts @@ -163,7 +163,9 @@ export default class SlTextarea extends ShoelaceElement implements ShoelaceFormC disconnectedCallback() { super.disconnectedCallback(); - this.resizeObserver.unobserve(this.input); + if (this.input) { + this.resizeObserver.unobserve(this.input); + } } private handleBlur() {