Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance UX with clickable items and simplified structure #5387

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions src/frontend/src/components/core/dropdownComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,31 +131,29 @@ export default function Dropdown({
<CommandEmpty>No values found.</CommandEmpty>
<CommandGroup defaultChecked={false}>
{filteredOptions?.map((option, index) => (
<ShadTooltip key={index} delayDuration={700} content={option}>
<div>
<CommandItem
value={option}
onSelect={(currentValue) => {
onSelect(currentValue);
setOpen(false);
}}
className="items-center overflow-hidden truncate"
data-testid={`${option}-${index}-option`}
>
{customValue === option && (
<span className="text-muted-foreground">Text:&nbsp;</span>
<div>
<CommandItem
value={option}
onSelect={(currentValue) => {
onSelect(currentValue);
setOpen(false);
}}
className="items-center overflow-hidden truncate hover:cursor-pointer"
data-testid={`${option}-${index}-option`}
>
{customValue === option && (
<span className="text-muted-foreground">Text:&nbsp;</span>
)}
<span className="truncate">{option}</span>
<ForwardedIconComponent
name="Check"
className={cn(
"ml-auto h-4 w-4 shrink-0 text-primary",
value === option ? "opacity-100" : "opacity-0",
)}
<span className="truncate">{option}</span>
<ForwardedIconComponent
name="Check"
className={cn(
"ml-auto h-4 w-4 shrink-0 text-primary",
value === option ? "opacity-100" : "opacity-0",
)}
/>
</CommandItem>
</div>
</ShadTooltip>
/>
</CommandItem>
</div>
))}
</CommandGroup>
</CommandList>
Expand Down
Loading