Skip to content

Commit

Permalink
feat: add faceted filters
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmann7 committed Mar 8, 2025
1 parent 63090a5 commit e0d7224
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/components/data-table/data-table-filter-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function DataTableFilterList<TData>({
}
/>
);
case "select": {
case "select":
return (
<Faceted
value={
Expand Down Expand Up @@ -271,7 +271,6 @@ export function DataTableFilterList<TData>({
</FacetedContent>
</Faceted>
);
}
case "multi-select": {
const selectedValues = Array.isArray(filter.value)
? filter.value
Expand Down Expand Up @@ -578,7 +577,7 @@ export function DataTableFilterList<TData>({
</span>
)}
</div>
<Popover modal>
<Popover>
<PopoverTrigger asChild>
<Button
id={fieldTriggerId}
Expand Down
2 changes: 1 addition & 1 deletion src/components/data-table/data-table-sort-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function DataTableSortList<TData>({
return (
<SortableItem key={sort.id} value={sort.id} asChild>
<div className="flex items-center gap-2">
<Popover modal>
<Popover>
<PopoverTrigger asChild>
<Button
id={fieldTriggerId}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/faceted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ function Faceted<Multiple extends boolean = false>(
onValueChange(selectedValue as FacetedValue<Multiple>);
}

// requestAnimationFrame(() => {
// setOpen(false);
// });
requestAnimationFrame(() => {
setOpen(false);
});
}
},
[multiple, onValueChange, value],
Expand Down

0 comments on commit e0d7224

Please sign in to comment.