Skip to content

Commit

Permalink
Disable select dropdown while loading
Browse files Browse the repository at this point in the history
  • Loading branch information
heisbrot committed Feb 16, 2024
1 parent 085662c commit d70e873
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/select/SelectDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ export function SelectDropdown({
setOpen(isOpen);
}}
>
<PopoverTrigger asChild={true}>
<PopoverTrigger asChild={true} disabled={disabled || isLoading}>
<Button
variant={"input"}
disabled={disabled}
disabled={disabled || isLoading}
ref={inputRef}
className={"w-full"}
>
Expand Down Expand Up @@ -181,7 +181,7 @@ export function SelectDropdown({
>
<CommandGroup>
<div className={"grid grid-cols-1 gap-1"}>
{filteredItems.slice(0, slice).map((option) => (
{filteredItems.map((option) => (
<SelectDropdownItem
option={option}
toggle={toggle}
Expand Down Expand Up @@ -212,8 +212,8 @@ const SelectDropdownItem = ({
const [visible, setVisible] = useState(isVisible);

useEffect(() => {
if (isVisible) {
setVisible(isVisible);
if (isVisible && !visible) {
setVisible(true);
}
}, [isVisible]);

Expand Down

0 comments on commit d70e873

Please sign in to comment.