mirror of
https://github.com/status-im/status-web-archive.git
synced 2025-02-17 18:16:27 +00:00
fix(react): do not submit empty message
This commit is contained in:
parent
e186ec7e79
commit
e338c67592
@ -34,6 +34,10 @@ export const ChatInput = (props: Props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (inputValue === '') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (event.key === 'Enter' && event.shiftKey === false) {
|
if (event.key === 'Enter' && event.shiftKey === false) {
|
||||||
onSubmit(inputValue)
|
onSubmit(inputValue)
|
||||||
setInputValue('')
|
setInputValue('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user