diff --git a/UI/editor.tsx b/UI/editor.tsx index 144a669..cd137ab 100644 --- a/UI/editor.tsx +++ b/UI/editor.tsx @@ -69,14 +69,9 @@ type EditorProps = { }; export class Editor extends Component { - textareaElement = createRef(); - - componentDidMount() { - this.textareaElement.current?.focus(); - } - render(props: EditorProps) { const uploadFileInput = createRef(); + const textareaElement = createRef(); const removeFile = (index: number) => { props.emit({ @@ -97,7 +92,7 @@ export class Editor extends Component { text: props.text, isGroupChat: props.isGroupChat, }); - this.textareaElement.current.setAttribute( + textareaElement.current.setAttribute( "rows", "1", ); @@ -187,7 +182,7 @@ export class Editor extends Component { : undefined}