You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to configure it: Only the value can be modified, the key can not be modified, the key cannot be added, and the deletion is not allowed
The text was updated successfully, but these errors were encountered:
josdejong
changed the title
How to configure it: Only the value can be modified, the key can not be modified, the key cannot be added, and the deletion is not allowed
How to configure a "form" mode, only allow editing values
Nov 29, 2023
The svelte-jsoneditor library is not very suitable for a "form" mode like you describe: only allowing edits of values.
I did a short experiment with creating an editor with readOnly=true, and then create a custom onRenderValue which ignores this readOnly prop, intercepts the onPatch event and applies that itself to the JSON data, but it comes with some difficulties (because of the readOnly mode of the editor, and also, quickkeys don't work etc).
Besides that, you'll need to disable text mode and table mode. You can hide the buttons from the menu using some CSS, though when loading invalid JSON, the editor will still show a button to switch to text mode, so it may be hard to take care of all those edge cases.
How to configure it: Only the value can be modified, the key can not be modified, the key cannot be added, and the deletion is not allowed
The text was updated successfully, but these errors were encountered: