diff --git a/.changeset/red-toys-thank.md b/.changeset/red-toys-thank.md new file mode 100644 index 00000000..fdf85061 --- /dev/null +++ b/.changeset/red-toys-thank.md @@ -0,0 +1,6 @@ +--- +"@tapsioss/web-components": patch +--- + +Fix issues with syncing height in auto-resizable mode in text-area + \ No newline at end of file diff --git a/packages/web-components/src/text-area/text-area.ts b/packages/web-components/src/text-area/text-area.ts index 840d34be..c2b65dfb 100644 --- a/packages/web-components/src/text-area/text-area.ts +++ b/packages/web-components/src/text-area/text-area.ts @@ -133,10 +133,10 @@ export class TextArea extends BaseTextInput { this._resizeSensor?.disconnect(); } - protected override firstUpdated(changed: PropertyValues): void { - super.firstUpdated(changed); + protected override updated(changed: PropertyValues): void { + super.updated(changed); - if (this.value) this._syncHeights(); + if (changed.has("value")) this._syncHeights(); } /** @internal */ @@ -225,12 +225,10 @@ export class TextArea extends BaseTextInput { } private _handleInput(event: Event) { - this._syncHeights(); this.handleInput(event); } private _handleChange(event: Event) { - this._syncHeights(); this.handleChange(event); }