Skip to content

Commit

Permalink
Intermediate level options don't show up
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrin2005 committed Jan 30, 2025
1 parent 6ea8e94 commit d739539
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/components/ui/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default function Autocomplete({
className="w-full justify-between"
disabled={disabled}
data-cy={dataCy}
onClick={() => setOpen(true)}
>
<span className={cn("truncate", !selectedOption && "text-gray-500")}>
{selectedOption ? selectedOption.label : placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,29 @@ export default function FacilityOrganizationSelector(
)}
<div className="flex-1 flex items-center gap-2">
<div className="flex-1">
<Autocomplete
value={selectedLevels[level]?.id}
options={getOrganizationOptions(orgList)}
onChange={(value) => handleLevelChange(value, level)}
placeholder={getDropdownLabel()}
/>
{level < selectedLevels.length &&
selectedLevels[level].has_children ? (
<div className="px-3 py-2 text-sm border rounded-md bg-white">
{selectedLevels[level].name}
</div>
) : (
<Autocomplete
value={selectedLevels[level]?.id}
options={getOrganizationOptions(orgList)}
onChange={(value) => handleLevelChange(value, level)}
placeholder={getDropdownLabel()}
/>
)}
</div>
{level > 0 && level < selectedLevels.length && (
<div
className="cursor-pointer p-1 hover:bg-gray-100 rounded-sm opacity-0 group-hover:opacity-100 transition-opacity"
onClick={() => handleEdit(level)}
>
<CareIcon icon="l-pen" className="h-4 w-4 text-gray-500" />
</div>
)}
{level < selectedLevels.length &&
selectedLevels[level].has_children && (
<div
className="cursor-pointer p-1 hover:bg-gray-100 rounded-sm opacity-0 group-hover:opacity-100 transition-opacity"
onClick={() => handleEdit(level)}
>
<CareIcon icon="l-pen" className="h-4 w-4 text-gray-500" />
</div>
)}
</div>
</div>
);
Expand Down

0 comments on commit d739539

Please sign in to comment.