diff --git a/services/web/frontend/js/directives/expandableTextArea.js b/services/web/frontend/js/directives/expandableTextArea.js index 5c217f2d95..05d23b03f6 100644 --- a/services/web/frontend/js/directives/expandableTextArea.js +++ b/services/web/frontend/js/directives/expandableTextArea.js @@ -15,10 +15,14 @@ define(['base'], App => const resetHeight = function() { const curHeight = el.outerHeight() const fitHeight = el.prop('scrollHeight') - - if (fitHeight > curHeight && el.val() !== '') { + // clear height if text area is empty + if (el.val() === '') { + el.css('height', 'unset') + } + // otherwise expand to fit text + else if (fitHeight > curHeight) { scope.$emit('expandable-text-area:resize') - return el.css('height', fitHeight) + el.css('height', fitHeight) } }