Skip to content

Commit

Permalink
Fix #4845: Menu filter bug fix swtiching match mode (#4876)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 4, 2023
1 parent 0bf4b83 commit 4dc9d33
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/lib/datatable/ColumnFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,14 @@ export const ColumnFilter = React.memo((props) => {
const onMenuMatchModeChange = (value, index) => {
const filterMatchModeChangeCallback = getColumnProp('onFilterMatchModeChange');
let filters = { ...props.filters };
let filterField = filters[field];

if (props.display === 'menu' && ObjectUtils.isNotEmpty(filterField.constraints)) {
filterField.constraints[index].matchMode = value;
} else {
filterField.matchMode = value;
}

filters[field].constraints[index].matchMode = value;
props.onFilterChange(filters);
filterMatchModeChangeCallback && filterMatchModeChangeCallback({ field, matchMode: value, index: index });

Expand Down

0 comments on commit 4dc9d33

Please sign in to comment.