mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-28 17:10:01 +00:00
Add Column data in autoRemove of Filters (#1906)
* Update utils.js * Update useFilters.js
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user