From e338c67592461b299f920cd59fba0f9aa42d46b7 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Mon, 20 Jun 2022 23:44:51 +0200 Subject: [PATCH] fix(react): do not submit empty message --- .../src/routes/chat/components/chat-input/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/status-react/src/routes/chat/components/chat-input/index.tsx b/packages/status-react/src/routes/chat/components/chat-input/index.tsx index a2c788ff..92bcd7d7 100644 --- a/packages/status-react/src/routes/chat/components/chat-input/index.tsx +++ b/packages/status-react/src/routes/chat/components/chat-input/index.tsx @@ -34,6 +34,10 @@ export const ChatInput = (props: Props) => { } const handleKeyDown = (event: React.KeyboardEvent) => { + if (inputValue === '') { + return + } + if (event.key === 'Enter' && event.shiftKey === false) { onSubmit(inputValue) setInputValue('')