webui: clamp input area width, default caret to end of textarea

This commit is contained in:
mappu 2023-04-08 19:22:30 +12:00
parent 575f7ac4bc
commit 8e378c0734
1 changed files with 4 additions and 0 deletions

View File

@ -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)) {