From 8e378c0734c3409715ef97820632d82cad26018c Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 8 Apr 2023 19:22:30 +1200 Subject: [PATCH] webui: clamp input area width, default caret to end of textarea --- webui.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webui.go b/webui.go index 4b0611f..7e88ae1 100644 --- a/webui.go +++ b/webui.go @@ -23,7 +23,9 @@ html { textarea { border-radius: 4px; display: block; + min-width: 100%; width: 100%; + max-width: 100%; min-height: 100px; background: #fff; @@ -56,6 +58,8 @@ function main() { const $main = document.getElementById("main"); const $state = document.getElementById("state"); + $main.setSelectionRange($main.value.length, $main.value.length); + $generate.addEventListener('click', async function() { const content = $main.value; if (content.split(" ").length >= (contextSize-4)) {