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

Allow onEdit to prevent a value from being updated #42

Open
felldiddy opened this issue Apr 18, 2024 · 0 comments
Open

Allow onEdit to prevent a value from being updated #42

felldiddy opened this issue Apr 18, 2024 · 0 comments

Comments

@felldiddy
Copy link

It would be very useful to use the onEdit handler to prevent a value from being updated, for instance:

<JsonView src={data} editable={{ edit: true }} onEdit={({ newValue }) => newValue === "something bad" ? false : true} />

In particular, this would support behavior where I don't want to allow a field that's a number to be changed to a string, or vice-versa (for one use case) by comparing the type of the old value to the type of the new value.

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

No branches or pull requests

1 participant