DataTable: page is not reseted after global filtering
I have DataTable without lazy loading with pagination and global filter. If I click to second page and then change filter input to leave only one record in table, then DataTable will not be reseted to the first page. The issue is reproducible on the demo page. https://www.primefaces.org/primereact/#/datatable/filter
http://prntscr.com/hb64za
@RushPVA, hello, i tried to reproduce this issue in demo page, but for me it works fine. datable-demo.pptx
Please check your browser console log to possible errors. If you are using google chrome, you can add https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi to help you
try global filter(not column filter)
i reproduced this issue on the last versions of Firefox and Chrome
It's happening on https://www.primefaces.org/primereact/#/datatable/filter (version maybe 2.0.0-rc.1)
Steps:
- Go to any page except the first page
- Search global with any value of the first page (ex.
ee8a89d8)
Expects:
Database should show 1 row contains ee8a89d8 at page 1
Actual: Database shows page 1 but with empty data
it doesnt work in React >= 16.7. maybe it's a componentWillReceiveProps method deprecation issue?
Workaround :
Add ref in the datatable definition
<DataTable
ref={(el) => this.dt = el}
.
.
.
</DataTable>
Add this line when the global filter value change
this.dt.setState({ first: 0 });