Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update row in list view redirect to first page #5185

Closed
ronfogel opened this issue Aug 24, 2020 · 4 comments · Fixed by #5263
Closed

Update row in list view redirect to first page #5185

ronfogel opened this issue Aug 24, 2020 · 4 comments · Fixed by #5263
Assignees
Labels

Comments

@ronfogel
Copy link

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:
#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
@djhi
Copy link
Collaborator

djhi commented Aug 28, 2020

Reproduced. Thanks for the report

@djhi djhi added the bug label Aug 28, 2020
@adylevy
Copy link

adylevy commented Sep 8, 2020

Hey,
Any ETA for a fix here?

@lashover
Copy link

lashover commented Sep 8, 2020

suffering from this as well, any update?

@jdemangeon jdemangeon self-assigned this Sep 16, 2020
@jdemangeon jdemangeon linked a pull request Sep 16, 2020 that will close this issue
@jdemangeon jdemangeon added this to the 3.8.5 milestone Sep 16, 2020
@jdemangeon
Copy link
Contributor

jdemangeon commented Sep 16, 2020

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

#5263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants