Skip to content

Commit 9cd5290

Browse files
BadriVishalPadhychronarkautofix-ci[bot]
authored
fix: Auditlogs Filters now can be clicked on (#2639)
* fix/Auditlogs-Filters-now-can-be-press-on-filter * [autofix.ci] apply automated fixes --------- Co-authored-by: Andreas Thomas <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 8226feb commit 9cd5290

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

apps/dashboard/app/(app)/audit/[bucket]/filter.tsx

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,41 +72,36 @@ export const Filter: React.FC<Props> = ({ options, title, param }) => {
7272
const isSelected = selected.includes(option.value);
7373

7474
return (
75-
<CommandItem
76-
/**
77-
* We're simulating next/link behavior here and prefetching the page when they hover over an item
78-
*/
79-
onMouseEnter={() => {
80-
const copySelected = new Set(selected);
81-
if (isSelected) {
82-
copySelected.delete(option.value);
83-
} else {
84-
copySelected.add(option.value);
85-
}
86-
// params.prefetch(param, Array.from(copySelected).join(","));
87-
}}
88-
key={option.value}
89-
onSelect={() => {
75+
<div
76+
onMouseDownCapture={() => {
9077
const next = isSelected
9178
? selected.filter((v) => v !== option.value)
9279
: Array.from(new Set([...selected, option.value]));
93-
9480
setSelected(next);
95-
// params.set(param, next);
9681
}}
9782
>
98-
<div
99-
className={cn(
100-
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
101-
isSelected
102-
? "bg-primary text-primary-foreground"
103-
: "opacity-50 [&_svg]:invisible",
104-
)}
83+
<CommandItem
84+
key={option.value}
85+
onSelect={() => {
86+
const next = isSelected
87+
? selected.filter((v) => v !== option.value)
88+
: Array.from(new Set([...selected, option.value]));
89+
setSelected(next);
90+
}}
10591
>
106-
<Check className={cn("h-4 w-4")} />
107-
</div>
108-
<span className="truncate text-ellipsis">{option.label}</span>
109-
</CommandItem>
92+
<div
93+
className={cn(
94+
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
95+
isSelected
96+
? "bg-primary text-primary-foreground"
97+
: "opacity-50 [&_svg]:invisible",
98+
)}
99+
>
100+
<Check className={cn("h-4 w-4")} />
101+
</div>
102+
<span className="truncate text-ellipsis">{option.label}</span>
103+
</CommandItem>
104+
</div>
110105
);
111106
})}
112107
</CommandGroup>

0 commit comments

Comments
 (0)