Skip to content

Commit

Permalink
Fix #4845: Datatable menu filter with singular text field
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 2, 2023
1 parent b897db0 commit 72b472f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/lib/datatable/ColumnFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ export const ColumnFilter = React.memo((props) => {
const onInputChange = (event, index) => {
let filters = { ...props.filters };
let value = event.target.value;
let filterField = filters[field];

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

props.onFilterChange(filters);
Expand Down

0 comments on commit 72b472f

Please sign in to comment.