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

Fire an event when the user edits/adds something in the json-editor #176

Open
ealvarez-sw opened this issue Feb 28, 2025 · 2 comments · Fixed by #178
Open

Fire an event when the user edits/adds something in the json-editor #176

ealvarez-sw opened this issue Feb 28, 2025 · 2 comments · Fixed by #178
Labels
user request Requested by user

Comments

@ealvarez-sw
Copy link

I want to block the form's save button when the user is editing the json in any way (adding new keys, editing a single value or an entire object, etc) to force them to undo/accept the changes in the editor before saving the entire form.

I think the easiest way to achieve this, is to fire an event when the user edits/adds something, allowing me to control the lock/unlock state of the button.

@ealvarez-sw ealvarez-sw added the user request Requested by user label Feb 28, 2025
@CarlosNZ
Copy link
Owner

Yeah, I've actually already started working on something like this as I've had a few similar requests: #138 #145

So keep an eye out in the next few weeks -- I'll post back here when I have a beta to try out.

@CarlosNZ CarlosNZ linked a pull request Mar 1, 2025 that will close this issue
CarlosNZ added a commit that referenced this issue Mar 9, 2025
@CarlosNZ CarlosNZ reopened this Mar 9, 2025
@CarlosNZ
Copy link
Owner

Hi @ealvarez-sw, this feature is now available in the lastest beta if you'd like to try it out: https://www.npmjs.com/package/json-edit-react/v/1.25.0-beta1

See the documentation for Event callbacks.

Please let me know if you have any feedback before I make this an official (non-beta) release.

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

Successfully merging a pull request may close this issue.

2 participants