material-react-table 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1810,9 +1810,18 @@ const MRT_FilterRangeSlider = ({ header, table }) => {
1810
1810
  })
1811
1811
  : columnDef.muiTableHeadCellFilterSliderProps;
1812
1812
  const sliderProps = Object.assign(Object.assign({}, mTableHeadCellFilterTextFieldProps), mcTableHeadCellFilterTextFieldProps);
1813
- const [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
1813
+ let [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
1814
1814
  ? [sliderProps.min, sliderProps.max]
1815
1815
  : (_a = column.getFacetedMinMaxValues()) !== null && _a !== void 0 ? _a : [0, 0];
1816
+ // column.getFacetedMinMaxValues() seems to return an array of arrays for the min value
1817
+ // under some conditions, so check for that and take the first array value if that happens.
1818
+ // To be a bit defensive, implement the same check for max, just in case.
1819
+ if (Array.isArray(min)) {
1820
+ min = min[0];
1821
+ }
1822
+ if (Array.isArray(max)) {
1823
+ max = max[0];
1824
+ }
1816
1825
  const [filterValues, setFilterValues] = react.useState([min, max]);
1817
1826
  const columnFilterValue = column.getFilterValue();
1818
1827
  const isMounted = react.useRef(false);