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

Handling Unsaved Changes in MUI Dialog with RJSF #4411

Open
1 task done
aress31 opened this issue Dec 9, 2024 · 1 comment
Open
1 task done

Handling Unsaved Changes in MUI Dialog with RJSF #4411

aress31 opened this issue Dec 9, 2024 · 1 comment
Labels
awaiting response feature Is a feature request

Comments

@aress31
Copy link

aress31 commented Dec 9, 2024

Prerequisites

What theme are you using?

mui

Is your feature request related to a problem? Please describe.

I am using a combination of MUI Dialog and my form inside it, and I would like to notify users of any unsaved changes before they close the dialog. Is there a way to achieve this with RJSF? If not, could this feature be considered for inclusion in the roadmap?

Describe the solution you'd like

We need a way to expose the global dirty state of the form, allowing us to handle it programmatically. This would enable us to prompt an error message in the Dialog's onClose event if the form is dirty.

Maybe a warnWhenUnsavedChanges option and a hook?

Describe alternatives you've considered

No response

@aress31 aress31 added feature Is a feature request needs triage Initial label given, to be assigned correct labels and assigned labels Dec 9, 2024
@heath-freenome
Copy link
Member

Does comparing the original formData passed initially into the form against the current formData returned by onChange() not work for you?

@heath-freenome heath-freenome added awaiting response and removed needs triage Initial label given, to be assigned correct labels and assigned labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response feature Is a feature request
Projects
None yet
Development

No branches or pull requests

2 participants