From 75940c1936d302f56005a850f1799762a5113a9b Mon Sep 17 00:00:00 2001 From: Dhravya Date: Sun, 30 Jun 2024 14:26:16 -0500 Subject: [PATCH] UX improvement: Create space disabled when input value is '' --- packages/ui/shadcn/combobox.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/ui/shadcn/combobox.tsx b/packages/ui/shadcn/combobox.tsx index ad70047f..4883ea19 100644 --- a/packages/ui/shadcn/combobox.tsx +++ b/packages/ui/shadcn/combobox.tsx @@ -57,8 +57,15 @@ const ComboboxWithCreate: React.FC = ({ type="button" onClick={async () => onSubmit(inputValue)} variant="link" + disabled={inputValue.length === 0} > - {createNewMessage} "{inputValue}" + {inputValue.length > 0 ? ( + <> + {createNewMessage} "{inputValue}" + + ) : ( + <>Create a space by typing here + )}

Start by creating a space and adding content to it