Skip to content

Unrestricted Open-source alternative to AI video platforms — Free AI image & video generation studio with 600+ models (Flux, Midjourney, Kling, Sora, Veo). No content filters. Self-hosted, MIT licensed.

fix(studio): implement auto-resize behavior for prompt textarea in VibeMotionStudio

Jaya Prasad Kavuru38971a194417
diff --git a/packages/studio/src/components/VibeMotionStudio.jsx b/packages/studio/src/components/VibeMotionStudio.jsx
index 4270ae2b..7e7d3440 100644
--- a/packages/studio/src/components/VibeMotionStudio.jsx
+++ b/packages/studio/src/components/VibeMotionStudio.jsx
@@ -107,6 +107,18 @@ export default function VibeMotionStudio({ apiKey, onGenerationComplete, onGener
document.addEventListener("mousedown", handler);
return () => document.removeEventListener("mousedown", handler);
}, []);
+ // ── Textarea auto-resize ──────────────────────────────────────────────────
+ const handleTextareaInput = () => {
+ const el = textareaRef.current;
+ if (!el) return;
+ el.style.height = "auto";
+ const maxHeight = window.innerWidth < 768 ? 150 : 250;
+ el.style.height = Math.min(el.scrollHeight, maxHeight) + "px";
+ };
+
+ useEffect(() => {
+ handleTextareaInput();
+ }, [prompt, editMode]);
// ── Timer ─────────────────────────────────────────────────────────────────
const startTimer = () => {
@@ -495,6 +507,7 @@ export default function VibeMotionStudio({ apiKey, onGenerationComplete, onGener
ref={textareaRef}
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
+ onInput={handleTextareaInput}
onKeyDown={handleKeyDown}
placeholder={
editMode