fix(react): do not submit empty message
This commit is contained in:
parent
66628d9c34
commit
5d65d4d95e
|
@ -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…
Reference in New Issue