From 735dc12c28b0362d1822010f8c3ba1cff070b2fa Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Tue, 10 Oct 2023 09:48:41 +0200 Subject: [PATCH] height --- packages/uui-textarea/lib/uui-textarea.element.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/uui-textarea/lib/uui-textarea.element.ts b/packages/uui-textarea/lib/uui-textarea.element.ts index e61e0912e..932c5f59a 100644 --- a/packages/uui-textarea/lib/uui-textarea.element.ts +++ b/packages/uui-textarea/lib/uui-textarea.element.ts @@ -316,6 +316,8 @@ export class UUITextareaElement extends FormControlMixin(LitElement) { // Note: Add + 2 because of the border top+bottom 1px each if (input.scrollHeight + 2 > input.clientHeight) { input.style.height = input.scrollHeight + 2 + 'px'; + } else if (input.scrollHeight + 2 < input.clientHeight) { + input.style.removeProperty('height'); } // Reset host styles and scroll to where we were