diff --git a/src/components/molecules/MessageInput/MessageInput.js b/src/components/molecules/MessageInput/MessageInput.js index 1ee8d27..f8f0b81 100644 --- a/src/components/molecules/MessageInput/MessageInput.js +++ b/src/components/molecules/MessageInput/MessageInput.js @@ -32,13 +32,15 @@ const MessageInput = ({ const handleChange = (e) => { const text = e.target.value setDisableButton(text.trim().length === 0) + if (onChange) { - onChange(text) + onChange(e) } } const handleKeyDown = (e) => { if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault() handleSubmit(e) } }