From 4288b44f2c119dfbcdbdb374dbbdf8d667b16df0 Mon Sep 17 00:00:00 2001 From: balajisoundar Date: Mon, 20 Sep 2021 12:19:50 +0530 Subject: [PATCH] chore: Invite user to org form input tab issue (#7603) Fixes: #6785 --- app/client/src/components/ads/TagInputComponent.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/client/src/components/ads/TagInputComponent.tsx b/app/client/src/components/ads/TagInputComponent.tsx index 38de855dc8..eb384e2097 100644 --- a/app/client/src/components/ads/TagInputComponent.tsx +++ b/app/client/src/components/ads/TagInputComponent.tsx @@ -104,12 +104,14 @@ function TagInputComponent(props: TagInputProps) { }; const onKeyDown = (e: any) => { - // Add new values to the tags on comma, return key, space and Tab press. + // Add new values to the tags on comma, return key, space and Tab press + // only if user has typed something on input if ( - e.key === "," || - e.key === "Enter" || - e.key === " " || - e.key === "Tab" + (e.key === "," || + e.key === "Enter" || + e.key === " " || + e.key === "Tab") && + e.target.value ) { const newValues = [...values, e.target.value]; commitValues(newValues);