-
Hi, I use the editor to edit different JSON files, each with a different JSON schema. The user can switch between the different JSON files with a select box. If the value changes, I update the content with the Unfortunately, if the user chooses "Undo" after the switch of the file, the former schema validator will not be restored, resulting in a ton of error messages, since the wrong validator (the new one) will be applied to the current file (which, through the 'undo', now is the former one). AFAIS, the best solution would be to reset the undo log when the user chooses to a new JSON file. Is there an API function to achieve this? Thanks for any suggestion |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can create a new editor instance, would that work? |
Beta Was this translation helpful? Give feedback.
You don't have to worry about performance and memory unless you're recreating the editor thousands of times. If you want to be sure, you can do a small experiment to see if you can notice any impact when recreating the editor.
I don't expect that the screen will flicker when recreating the editor, though you will lose for example the scroll position that the user had. Again, you can probably validate this in a few minutes by just trying it out.
If there is enough need for control over the history, we can think through an API for that.