Add Column data in autoRemove of Filters (#1906)

* Update utils.js

* Update useFilters.js
This commit is contained in:
gargroh
2020-02-15 01:45:38 +05:30
committed by GitHub
parent 98b3161b2d
commit 32ca5a240b
2 changed files with 4 additions and 4 deletions

View File

@@ -68,7 +68,7 @@ function reducer(state, action, previousState, instance) {
)
//
if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter)) {
if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter, column)) {
return {
...state,
filters: state.filters.filter(d => d.id !== columnId),
@@ -108,7 +108,7 @@ function reducer(state, action, previousState, instance) {
filterTypes
)
if (shouldAutoRemoveFilter(filterMethod.autoRemove, filter.value)) {
if (shouldAutoRemoveFilter(filterMethod.autoRemove, filter.value, column)) {
return false
}
return true

View File

@@ -369,8 +369,8 @@ export function getFilterMethod(filter, userFilterTypes, filterTypes) {
)
}
export function shouldAutoRemoveFilter(autoRemove, value) {
return autoRemove ? autoRemove(value) : typeof value === 'undefined'
export function shouldAutoRemoveFilter(autoRemove, value, column) {
return autoRemove ? autoRemove(value, column) : typeof value === 'undefined'
}
export function unpreparedAccessWarning() {