autoexpand generated textareas too

pull/139/head
Aevann 2023-03-12 16:09:43 +02:00
parent 835c5f810d
commit 965a484595
2 changed files with 8 additions and 8 deletions

View File

@ -146,6 +146,14 @@ function register_new_elements(e) {
for (const element of onclick) {
element.onclick = () => {execute(element, 'onclick')};
}
const textareas = e.getElementsByTagName('textarea')
for (const element of textareas) {
autoExpand(element)
element.addEventListener('input', () => {
autoExpand(element)
});
}
}
register_new_elements(document);

View File

@ -145,14 +145,6 @@ function autoExpand(field) {
window.scrollTo(xpos,ypos);
};
const textareas = document.getElementsByTagName('textarea')
for (const element of textareas) {
autoExpand(element)
element.addEventListener('input', () => {
autoExpand(element)
});
}
function smoothScrollTop()
{
window.scrollTo({ top: 0, behavior: 'smooth' });