better gui

This commit is contained in:
2025-12-10 22:54:41 +01:00
parent 0339054f73
commit 1ee16327e9
2 changed files with 92 additions and 30 deletions

View File

@@ -0,0 +1,18 @@
import { tick } from "svelte";
export function autoGrow(node) {
function resize() {
node.style.height = "auto";
node.style.height = node.scrollHeight + "px";
}
// wait until DOM updates to apply initial value
tick().then(resize);
node.addEventListener("input", resize);
return {
destroy() {
node.removeEventListener("input", resize);
}
};
}