MCPcopy Create free account
hub / github.com/outerbase/studio / handleResize

Function handleResize

src/components/editor/prompt-widget.tsx:58–69  ·  view source on GitHub ↗
(e: React.KeyboardEvent<HTMLTextAreaElement>)

Source from the content-addressed store, hash-verified

56 const minHeight = 60;
57
58 const handleResize = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
59 if (fakeTextareaRef.current && textareaRef.current) {
60 fakeTextareaRef.current.value = e.currentTarget.value;
61 const newHeight = Math.max(
62 minHeight,
63 fakeTextareaRef.current.scrollHeight
64 );
65
66 setHeight(Math.max(minHeight, fakeTextareaRef.current.scrollHeight));
67 textareaRef.current.style.height = newHeight + "px";
68 }
69 };
70
71 const showSubmitButton = !previousPrompt && prompt;
72 const showSubmitEditButton = previousPrompt && previousPrompt !== prompt;

Callers 1

CodeMirrorPromptWidgetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected