diff --git a/list-editor/textarea.autosize.js b/list-editor/textarea.autosize.js index aa8d886..3595d95 100644 --- a/list-editor/textarea.autosize.js +++ b/list-editor/textarea.autosize.js @@ -21,7 +21,9 @@ function textareaAutosizeIinit($) { parseInt(this.$element.css('borderBottomWidth')) || 0; if (containsText(this.element.value)) { - this.$element.height(this.element.scrollHeight - diff); + let height = this.element.scrollHeight - diff; + height = 24 * Math.round(height / 24) + this.$element.height(height); } // keyup is required for IE to properly reset height when deleting text @@ -29,9 +31,11 @@ function textareaAutosizeIinit($) { var $window = $(window); var currentScrollPosition = $window.scrollTop(); + let height = this.scrollHeight - diff; + height = 24 * Math.round(height / 24) $(this) .height(0) - .height(this.scrollHeight - diff); + .height(height); $window.scrollTop(currentScrollPosition); });