Skip to content

Unsaved changes warning not compatible with Edit component #11274

@st-the-cloud

Description

@st-the-cloud

In an Edit component, when 'warnWhenUnsavedChanges' is set in the child SimpleForm component, I would expect the delete button to still work like normal.

Instead, if I press 'Delete' after making changes to a field, I get the unsaved changes warning, and if I ignore it (i.e. click cancel) the page stays on the now stale Edit page and things stop working correctly (for example, pressing save results in a Not Found error).

To reproduce, simply set warnWhenUnsavedChanges in the SimpleForm component of an Edit component, then go to the edit component, begin editing a field, then press delete (if mutation mode is set to pessimistic, click OK on the delete confirmation modal).

React-admin version: 5.14.6
React version: 19.2.5
Browser: Google Chrome 149.0.7827.103

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions