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.
@@ -1733,9 +1733,18 @@ const MRT_FilterRangeSlider = ({ header, table }) => {
1733
1733
  })
1734
1734
  : columnDef.muiTableHeadCellFilterSliderProps;
1735
1735
  const sliderProps = Object.assign(Object.assign({}, mTableHeadCellFilterTextFieldProps), mcTableHeadCellFilterTextFieldProps);
1736
- const [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
1736
+ let [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
1737
1737
  ? [sliderProps.min, sliderProps.max]
1738
1738
  : (_a = column.getFacetedMinMaxValues()) !== null && _a !== void 0 ? _a : [0, 0];
1739
+ // column.getFacetedMinMaxValues() seems to return an array of arrays for the min value
1740
+ // under some conditions, so check for that and take the first array value if that happens.
1741
+ // To be a bit defensive, implement the same check for max, just in case.
1742
+ if (Array.isArray(min)) {
1743
+ min = min[0];
1744
+ }
1745
+ if (Array.isArray(max)) {
1746
+ max = max[0];
1747
+ }
1739
1748
  const [filterValues, setFilterValues] = useState([min, max]);
1740
1749
  const columnFilterValue = column.getFilterValue();
1741
1750
  const isMounted = useRef(false);