From 200c3536450a2ab87f339767cad900656d47129a Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 16 Jun 2020 11:58:48 -0400 Subject: [PATCH] fix(mail(js)): use initial number of rows of textarea with sgAutogrow --- UI/WebServerResources/js/Common/sgAutogrow.directive.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Common/sgAutogrow.directive.js b/UI/WebServerResources/js/Common/sgAutogrow.directive.js index 760be1449..b27e83b16 100644 --- a/UI/WebServerResources/js/Common/sgAutogrow.directive.js +++ b/UI/WebServerResources/js/Common/sgAutogrow.directive.js @@ -29,6 +29,7 @@ if (!scope.autogrow) return; var textarea = elem[0]; + var minHeight = textarea.clientHeight; var hiddenDiv = $document[0].createElement('div'); var content = null; @@ -49,7 +50,7 @@ hiddenDiv.innerHTML = content + '
'; hiddenDiv.style.visibility = 'hidden'; hiddenDiv.style.display = 'block'; - textarea.style.height = hiddenDiv.offsetHeight + 'px'; + textarea.style.height = Math.max(minHeight, hiddenDiv.offsetHeight) + 'px'; hiddenDiv.style.visibility = 'visible'; hiddenDiv.style.display = 'none'; });