Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
keisuke-umezawa committed Apr 17, 2024
1 parent 83248d9 commit 5bb1c08
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions optuna_dashboard/ts/components/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,19 +523,17 @@ function DataGrid2(props: {
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
const order = header.column.getIsSorted()
const filterChoices = header.column.getCanFilter()
? Array.from(
header.column.getFacetedUniqueValues().keys()
).sort()
: []
if (
header.column.getCanFilter() &&
!header.column.getIsFiltered()
) {
header.column.setFilterValue([])
console.log(header.column.getFilterValue())
}
const order = header.column.getIsSorted()
const filterChoices = header.column.getCanFilter()
? Array.from(
header.column.getFacetedUniqueValues().keys()
).sort() : null
return (
<TableCell key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder ? null : (
Expand Down Expand Up @@ -564,7 +562,7 @@ function DataGrid2(props: {
header.getContext()
)
)}
{header.column.getCanFilter() ? (
{filterChoices !== null ? (
<>
<IconButton
size="small"
Expand Down

0 comments on commit 5bb1c08

Please sign in to comment.