React-admin: Export button is not getting updated when `total` is updated

Created on 26 Dec 2019  路  6Comments  路  Source: marmelab/react-admin

What you were expecting:
Expecting the Export button to get re-rendered when the total is changed

What happened instead:
The Export button was not changed

Steps to reproduce:
visit a resource's list page directly using the link (or by refreshing it)

Related code:
At this line of code the total property is not included in the onlyUpdateForKeys list which causes the export button not to be refreshed when the {data, total} pair is updated.
Meanwhile at this line of code the export button is total dependent.

Also, I've checked the 3.x version, there the total is included as written at this line of code

Possible Solution
Just add total to the list of onlyUpdateForKeys.

Other information:
None

Environment

  • React-admin version: 2.9.5
  • Last version that did not exhibit the issue (if applicable): idk
  • React version: 16.9.0
  • Browser: google chrome
  • Stack trace (in case of a JS error): none
bug good first issue v2

All 6 comments

Thanks for the issue.

@djhi @jdemangeon
Is anyone working on it?
If not then, I can.

With pleasure @manishsundriyal ;)

@djhi @jdemangeon @fzaninotto
If you have some time, then please review https://github.com/marmelab/react-admin/pull/4694
I have raised the PR only against the 2.x branch. As this bug is not in the master.
Let me know if it requires any further updates.

@djhi @fzaninotto
Shouldn't this be closed now?

Fixed by #4694

Was this page helpful?
0 / 5 - 0 ratings