diff --git a/src/chatbox.tsx b/src/chatbox.tsx index 4fc5952..bcae76e 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -392,6 +392,7 @@ export default function ChatBOX(props: { ); _setToolsTemplates(templateTools); }; + const userInputRef = createRef(); return (
@@ -812,9 +813,10 @@ export default function ChatBOX(props: { )} diff --git a/src/textarea.tsx b/src/textarea.tsx index f8a807d..570a28e 100644 --- a/src/textarea.tsx +++ b/src/textarea.tsx @@ -1,9 +1,9 @@ -export const autoHeight = (event: any) => { - event.target.style.height = "auto"; +export const autoHeight = (target: any) => { + target.style.height = "auto"; // max 70% of screen height - event.target.style.height = `${Math.min( - event.target.scrollHeight, + target.style.height = `${Math.min( + target.scrollHeight, window.innerHeight * 0.7 )}px`; - console.log("set auto height", event.target.style.height); + console.log("set auto height", target.style.height); };