Skip to content

Commit

Permalink
fix: Lint error using onClick on a div #2756 (#2778)
Browse files Browse the repository at this point in the history
  • Loading branch information
GARY121github authored Dec 23, 2024
1 parent ad3d498 commit 886821d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/dashboard/app/(app)/audit/components/filters/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export const Filter: React.FC<Props> = ({ options, title, param }) => {
{options.map((option) => {
const isSelected = selected.includes(option.value);
return (
<div
<Button
className="w-full p-0 m-0 bg-transparent border-none shadow-none outline-none text-inherit flex-none"
key={option.value}
onClick={() => handleSelection(option.value, isSelected)}
onKeyDown={(e) => {
Expand All @@ -92,6 +93,7 @@ export const Filter: React.FC<Props> = ({ options, title, param }) => {
}}
>
<CommandItem
className="w-full"
onSelect={() => {
const next = isSelected
? selected.filter((v) => v !== option.value)
Expand All @@ -111,7 +113,7 @@ export const Filter: React.FC<Props> = ({ options, title, param }) => {
</div>
<span className="truncate text-ellipsis">{option.label}</span>
</CommandItem>
</div>
</Button>
);
})}
</CommandGroup>
Expand Down

0 comments on commit 886821d

Please sign in to comment.