Material-table: PageSize dont change if new props in option appear

Created on 12 Feb 2020  路  3Comments  路  Source: mbrn/material-table

Describe the bug
Hi, @mbrn in material-table.js file, inside the function setDataManagerFields i recommend use the solution
if( isInit && this.isRemoteData() )
{
this.dataManager.changePageSize(props.options.pageSize);
}

This will avoid the problem that the table load the prop pageSize of "option" no matter if pageSize was changed manually. The reason is because if in the code some props are changed dinamically that make the pageSize change.

For your info, just in case, and save you time
I found the commit where the actual solution was added:
Actual code:
(isInit || this.isRemoteData()) && this.dataManager.changePageSize(props.options.pageSize);

It was added in the commit 6d708f3, because the issues 1353, and released in the version 1.54.1

I checked and still acomplish
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

wontfix

Most helpful comment

All 3 comments

@mbrn Could you have a look at this?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings