diff --git a/frontend/src/components/Editor.tsx b/frontend/src/components/Editor.tsx index 0ba6597..3881f0a 100644 --- a/frontend/src/components/Editor.tsx +++ b/frontend/src/components/Editor.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef } from 'react' +import { useRef } from 'react' interface EditorProps { content: string @@ -10,19 +10,6 @@ interface EditorProps { export function Editor({ content, onChange, placeholder, disabled }: EditorProps) { const textareaRef = useRef(null) - // Auto-resize textarea - const adjustHeight = useCallback(() => { - const textarea = textareaRef.current - if (textarea) { - textarea.style.height = 'auto' - textarea.style.height = `${textarea.scrollHeight}px` - } - }, []) - - useEffect(() => { - adjustHeight() - }, [content, adjustHeight]) - const handleChange = (e: React.ChangeEvent) => { onChange(e.target.value) } @@ -55,11 +42,12 @@ export function Editor({ content, onChange, placeholder, disabled }: EditorProps onKeyDown={handleKeyDown} placeholder={placeholder} disabled={disabled} - className="w-full h-full min-h-full p-6 resize-none outline-none border-none + className="w-full h-full p-6 resize-none outline-none border-none bg-transparent font-mono text-sm leading-relaxed text-gray-800 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-600 - disabled:opacity-50 disabled:cursor-not-allowed" + disabled:opacity-50 disabled:cursor-not-allowed + overflow-auto" spellCheck={false} />