auto height for textarea
This commit is contained in:
parent
472c1c3e81
commit
b76e079ab9
15
public/akaunting-js/generalAction.js
vendored
15
public/akaunting-js/generalAction.js
vendored
@ -277,4 +277,17 @@ function runTooltip(tooltipToggleEl) {
|
||||
tooltipToggleEl.addEventListener(event, hide);
|
||||
});
|
||||
}
|
||||
// Tooltip elements using [data-tooltip-target], [data-tooltip-placement]
|
||||
// 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
|
@ -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
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user