fix: show placeholder select while waiting for load

This commit is contained in:
Eric Lewis 2024-04-09 14:10:39 -04:00
parent f38dfb5604
commit ea6ad52a73
2 changed files with 22 additions and 16 deletions

View File

@ -219,6 +219,7 @@ export const Select = ({
getItemProps, getItemProps,
openMenu, openMenu,
} = useCombobox({ } = useCombobox({
defaultInputValue: (options[0] as unknown as SelectOption)?.value,
items: filteredItems, items: filteredItems,
selectedItem: multiple ? null : (value as SelectOption) || null, selectedItem: multiple ? null : (value as SelectOption) || null,
// @ts-expect-error there are two params but we don't need the second one // @ts-expect-error there are two params but we don't need the second one

View File

@ -143,8 +143,10 @@ const CreateRepo = () => {
The project will be cloned into this repository The project will be cloned into this repository
</Heading> </Heading>
</div> </div>
<div className="flex flex-col justify-start gap-3"> <div className="flex flex-col justify-start gap-3">
<span className="text-sm text-elements-high-em">Git account</span> <span className="text-sm text-elements-high-em">Git account</span>
{gitAccounts.length > 0 ? (
<Controller <Controller
name="account" name="account"
control={control} control={control}
@ -161,6 +163,9 @@ const CreateRepo = () => {
/> />
)} )}
/> />
) : (
<Select options={[]} disabled />
)}
</div> </div>
<div className="flex flex-col justify-start gap-3"> <div className="flex flex-col justify-start gap-3">
<span className="text-sm text-elements-high-em">Name the repo</span> <span className="text-sm text-elements-high-em">Name the repo</span>