-
Notifications
You must be signed in to change notification settings - Fork 117
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
Flag for programmatic vs UI changes #145
Comments
I’d been struggling on this too while making json-editor-vue, I use two flags to solve this. |
Thanks @cloydlau I'll go have a look at how you solved it |
Thanks Werner, very good point. For reference: the reason that I recently change the behavior from I agree that the old behavior is also very handy to prevent infinite loops and needless callbacks. So both cases can be useful, and your idea to be able to distinguish programmatic vs user changes makes sense. For the time being: you can indeed set some flag before doing a programmatic update, and reset it after the update, and in the |
Thanks Jos, I'll do the flag thing for now. |
In |
Hi Jos
I'm a big fan of your original library, we used it to develop a collaborative JSON editor.
The key functionality we relied on was that setting the content programmatically didn't emit a onChange.
This prevented loops in the 2 editors updating each other. When we set the content a onChange didn't happen, when the human made a change we picked that up and transmitted to the other editor and did a programatic update.
Is there anyway to enhance the Svelte component to maybe pass a flag letting us know if it was a change from called the set() or update() functions or if the change was a result of a UI edit.
Regards
The text was updated successfully, but these errors were encountered: