diff --git a/src/components/textarea/textarea.component.ts b/src/components/textarea/textarea.component.ts index e76dfbf1..903c66ca 100644 --- a/src/components/textarea/textarea.component.ts +++ b/src/components/textarea/textarea.component.ts @@ -153,7 +153,7 @@ export default class SlTextarea extends ShoelaceElement implements ShoelaceFormC this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight()); this.updateComplete.then(() => { - this.setTextareaHeight(); + this.setTextareaHeight(true); this.resizeObserver.observe(this.input); }); } @@ -195,13 +195,14 @@ export default class SlTextarea extends ShoelaceElement implements ShoelaceFormC this.formControlController.emitInvalidEvent(event); } - private setTextareaHeight() { + private setTextareaHeight(isProgrammatic?: boolean) { if (this.resize === 'auto') { // This prevents layout shifts. We use `clientHeight` instead of `scrollHeight` to account for if the `