1 parent c83971b commit d99ce44Copy full SHA for d99ce44
1 file changed
apps/codebility/app/home/feeds/_components/MarkdownEditor.tsx
@@ -24,6 +24,14 @@ export default function MarkdownEditor({
24
if (onChange) onChange(value);
25
}, [value, onChange]);
26
27
+ useEffect(() => {
28
+ // Auto-resize textarea for nicer UX
29
+ const ta = textareaRef.current;
30
+ if (!ta) return;
31
+ ta.style.height = "0px";
32
+ ta.style.height = Math.min(ta.scrollHeight, 800) + "px"; // limit max-height
33
+ }, [value, tab]);
34
+
35
// notify parent whenever uploadedIds changes
36
useEffect(() => {
37
if (onImagesUploaded) onImagesUploaded(uploadedIds);
0 commit comments