From 972a898039752719596cb8fa6309c25c9db0676d Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 4 Feb 2019 09:30:06 +0100 Subject: [PATCH] Fix form submit --- src/components/ChatRoom.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ChatRoom.js b/src/components/ChatRoom.js index 598d44e..24c6f01 100644 --- a/src/components/ChatRoom.js +++ b/src/components/ChatRoom.js @@ -60,7 +60,7 @@ const keyDownHandler = (e, typingEvent, setValue, value) => { else if (e.keyCode === 13) { e.preventDefault(); const form = ChatRoomForm.current; - form.dispatchEvent(new Event("submit")); + form.submitForm(); } typingEvent(e) }; @@ -152,6 +152,7 @@ class ChatRoom extends Component { ))} { const { chatInput } = values; @@ -170,7 +171,7 @@ class ChatRoom extends Component { setFieldValue }) => (
-
+