Skip to content

Commit

Permalink
Fix #4845: Datatable menu filter with singular text field (#4865)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 2, 2023
1 parent 0e3e14a commit ffec750
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 ffec750

Please sign in to comment.