Skip to content

Commit 7144e20

Browse files
Fran McDadeFran McDade
authored andcommitted
fix: min max default values from facetedminmaxvalues (#440)
1 parent 22eb56a commit 7144e20

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/components/Table/common/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ export function buildCategoryViews<T extends RowData>(
5454
const label = columnHeader as string;
5555
// Handle range categories.
5656
if (columnDef.filterFn === "inNumberRange") {
57-
const [min = -Infinity, max = Infinity] =
58-
getFacetedMinMaxValues() || [];
57+
const [min, max] = getFacetedMinMaxValues() || [];
5958
categoryViews.push({
6059
key,
6160
label,
62-
max,
63-
min,
61+
max: max ?? Infinity,
62+
min: min ?? -Infinity,
6463
selectedMax: null, // Selected state updated in reducer.
6564
selectedMin: null, // Selected state updated in reducer.
6665
});

0 commit comments

Comments
 (0)