-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
warnWhenUnsavedChanges not working when navigating to show from edit #8338
Comments
Thanks. {/* FIXME: added with resource prop because react-router HashHistory cannot block navigation induced by address bar changes */}
<ShowButton resource="posts" record={record} />
{/* FIXME: added with resource prop because react-router HashHistory cannot block navigation induced by address bar changes */}
<CreateButton resource="posts" label="Create post" /> Would you like to create a Pull Request with this fix? |
https://codesandbox.io/s/wizardly-rain-7p6pxp?file=/src/comments/CommentEdit.tsx:2650-2665 That's not really a fix even for
But… |
Your original concern is the main issue here, I will look into it. |
What you were expecting:
In the simple example https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple, when I navigate to a comment, edit the author name for example, and click the show button, I expect to have an alert saying my changes weren't saved.
What happened instead:
No alert is displayed and my changes are lost.
When I click on an other resource in the menu, the alert is displayed.
The text was updated successfully, but these errors were encountered: