diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index deb36a43b..5a35ce460 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -277,4 +277,17 @@ function runTooltip(tooltipToggleEl) { tooltipToggleEl.addEventListener(event, hide); }); } -// Tooltip elements using [data-tooltip-target], [data-tooltip-placement] \ No newline at end of file +// Tooltip elements using [data-tooltip-target], [data-tooltip-placement] + +//Auto Height for Textarea +const tx = document.querySelectorAll('[textarea-auto-height]'); +for (let i = 0; i < tx.length; i++) { + tx[i].setAttribute('style', 'height:' + (tx[i].scrollHeight) + 'px;overflow-y:hidden;'); + tx[i].addEventListener('input', OnInput, false); +} + +function OnInput() { + this.style.height = 'auto'; + this.style.height = (this.scrollHeight) + 'px'; +} +//Auto Height for Textarea \ No newline at end of file diff --git a/resources/views/components/documents/form/note.blade.php b/resources/views/components/documents/form/note.blade.php index f52eb32ad..10ea8066e 100644 --- a/resources/views/components/documents/form/note.blade.php +++ b/resources/views/components/documents/form/note.blade.php @@ -8,5 +8,6 @@ form-label-class="lg:text-lg" form-group-class="border-b pb-2 mb-3.5" rows="1" + textarea-auto-height />