diff --git a/web/src/features/message/components/MessageComposer.tsx b/web/src/features/message/components/MessageComposer.tsx index df8782c..ad40001 100644 --- a/web/src/features/message/components/MessageComposer.tsx +++ b/web/src/features/message/components/MessageComposer.tsx @@ -25,9 +25,9 @@ export const MessageComposer = ({ const [disabled, setDisabled] = useState(false) const socketRef = useRef(getSocketIO()) const timeoutRef = useRef() - const textAreaRef = useRef(null) + const inputRef = useRef(null) - useAutoFocus(textAreaRef, [groupId, receiverId, replyMessage]) + useAutoFocus(inputRef, [groupId, receiverId, replyMessage]) const handleChange = (e: React.ChangeEvent) => { setText(e.target.value) @@ -80,17 +80,17 @@ export const MessageComposer = ({ handleComposeMessage() } - const handleKeyDown = (event: React.KeyboardEvent) => { - if (event.key === 'Enter' && !event.shiftKey) { - event.preventDefault() - } - if (event.key === 'Enter') { - if (!event.shiftKey) { - event.preventDefault() - handleComposeMessage() - } - } - } + // const handleKeyDown = (event: React.KeyboardEvent) => { + // if (event.key === 'Enter' && !event.shiftKey) { + // event.preventDefault() + // } + // if (event.key === 'Enter') { + // if (!event.shiftKey) { + // event.preventDefault() + // handleComposeMessage() + // } + // } + // } return (