React-admin: Update row in list view redirect to first page

Created on 24 Aug 2020  路  4Comments  路  Source: marmelab/react-admin

What you were expecting:
When updating a row using useUpdate hook inside a List, trigger onSuccess, stay on the same page and keep same query params

What happened instead:
After updating a row using useUpdate hook:

  1. if undoable was set to false, the onSuccess didn't trigger and therefore I could not show a notify that it was updated successfully.
  2. After the update succeeds, I was redirected to the first page

Steps to reproduce:

  1. Go to your own demo https://marmelab.com/react-admin-demo/#/reviews
  2. Navigate to reviews tab (if you went there from the link above, it's already in reviews)
  3. Navigate to any page except for page 1
  4. Mark/select/tick one of the rows so you will see the "quick actions" toolbar at the top
  5. Click on "Accept" or "Reject" - because undoable is set to true, you will see the notify.
  6. Click anywhere so the update will actually happen
  7. Notice that you have been redirected to the first page.

Screen Shot 2020-08-24 at 22 37 25

Related code:
Since I can reproduce it in your own demo, I guess the related code is your AcceptButton and RejectButton
https://github.com/marmelab/react-admin/blob/master/examples/demo/src/reviews/AcceptButton.tsx
https://github.com/marmelab/react-admin/blob/master/examples/demo/src/reviews/RejectButton.tsx

Other information:
I kind of saw something similar to what I mention in the past:
https://github.com/marmelab/react-admin/issues/4902

It states that it was fixed so I don't know if indeed it is related or not.

Also, we are using the update feature as inline edit across our whole project so this is kind critical for us to be fixed as soon as possible.

Environment

  • React-admin version: 3.8.2
  • React version: 16.13.1
  • Browser: Chrome
bug

Most helpful comment

Hello @adylevy @lashover! Yes there's an update ;)
A PR is pending for review.

https://github.com/marmelab/react-admin/pull/5263

All 4 comments

Reproduced. Thanks for the report

Hey,
Any ETA for a fix here?

suffering from this as well, any update?

Hello @adylevy @lashover! Yes there's an update ;)
A PR is pending for review.

https://github.com/marmelab/react-admin/pull/5263

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ilaif picture ilaif  路  3Comments

kikill95 picture kikill95  路  3Comments

yangjiamu picture yangjiamu  路  3Comments

aserrallerios picture aserrallerios  路  3Comments

ericwb picture ericwb  路  3Comments