Closed
Description
Describe the bug
After reordering columns, the filtering either: works, filters another column, breaks altogether (as the below demo illustrates).
To Reproduce
Steps to reproduce the behavior:
- Go to https://material-table-core.com/demos/filter/custom-filter/
- Drag a column around (e.g. Birth Year)
- Try filtering
- See error
Expected behavior
Filtering continues to filter the moved column.
Desktop (please complete the following information):
- OS: MacOS 12.2.1
- Browser: Chrome
- Version: 98.0.4758.109
Additional context
When filtering we pass the columnId
to the filter function.
This eventually ends up in the dataManager's changeFilterValue
function, which uses the columnId
as an index.
This is where the mismatch happens. The columnId
is not necessarily the same as the column index at this point and it ends up trying to filter a different column.