Skip to content

Commit

Permalink
now handleChange send event
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Di Nella committed Oct 10, 2023
1 parent c7d7b5c commit f663b77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/molecules/MessageInput/MessageInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit f663b77

Please sign in to comment.