From 6e249bc54079e711da98cae8ef137fa216c729b6 Mon Sep 17 00:00:00 2001 From: Surendran <80509210+coderSuren@users.noreply.github.com> Date: Thu, 15 Jun 2023 13:32:33 +0530 Subject: [PATCH] fix: Added onKeyDown function for input field (#6699) * Added onKeyDown function for input field * Updated CreateOrganization.jsx --- .../OrganizationManager/CreateOrganization.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx index 7a2f91709b..adfd77ef71 100644 --- a/frontend/src/_components/OrganizationManager/CreateOrganization.jsx +++ b/frontend/src/_components/OrganizationManager/CreateOrganization.jsx @@ -35,6 +35,13 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => { } }; + const handleKeyDown = (e) => { + if (e.keyCode === 13) { + e.preventDefault(); + createOrganization(); + } + }; + const handleInputChange = (e) => { const value = e.target.value; setErrorText(''); @@ -62,6 +69,7 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {