add autoheight for textarea (again)
This commit is contained in:
parent
66ce42e6e4
commit
d0576188e0
10
autosize.js
Normal file
10
autosize.js
Normal file
@ -0,0 +1,10 @@
|
||||
function autosize(tx) {
|
||||
for (let i = 0; i < tx.length; i++) {
|
||||
tx[i].setAttribute("style", "height:" + (tx[i].scrollHeight) + "px;overflow-y:hidden;");
|
||||
tx[i].addEventListener("input", OnInputAutoSize, false);
|
||||
}
|
||||
}
|
||||
function OnInputAutoSize() {
|
||||
this.style.height = "auto";
|
||||
this.style.height = (this.scrollHeight) + "px";
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user