diff --git a/assets/js/components/Table/filters.jsx b/assets/js/components/Table/filters.jsx index 9ce66bcafe..00fcb4fc9a 100644 --- a/assets/js/components/Table/filters.jsx +++ b/assets/js/components/Table/filters.jsx @@ -14,12 +14,12 @@ const setFilter = (filters, filterKey, filterValue, filterFunction) => { const { key } = current; return filterKey === key ? { - found: true, - filtersList: [ - ...filtersList, - { key, value: filterValue, filterFunction }, - ], - } + found: true, + filtersList: [ + ...filtersList, + { key, value: filterValue, filterFunction }, + ], + } : { found, filtersList: [...filtersList, current] }; }, { found: false, filtersList: [] } @@ -45,7 +45,7 @@ export const TableFilters = ({ config, data, filters, onChange }) => { .map((column) => { const filterValue = getFilter(column.key, filters); const filterOptions = uniq( - data.map(({ [column.key]: option }) => option).flat(Infinity) + data.map(({ [column.key]: option }) => option).flat(Infinity).concat(filterValue) ); return (