UX improvement: Create space disabled when input value is ''

This commit is contained in:
Dhravya 2024-06-30 14:26:16 -05:00
parent 7b5f26e54e
commit 75940c1936

View file

@ -57,8 +57,15 @@ const ComboboxWithCreate: React.FC<ComboboxWithCreateProps> = ({
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</>
)}
</Button>
<p>Start by creating a space and adding content to it</p>
</CommandEmpty>