-
Notifications
You must be signed in to change notification settings - Fork 112
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
throw 'RangeError: Invalid position 1 in document of length 0' when calling set
method with JSON value under text mode
#381
Comments
A quick work around I'm using is to create it in tree mode; then immediately call |
Thanks for the reproduction Cloyd, that helps. The steps to reproduce are:
The error only occurs when the new contents have a large length, i.e. to get the error again, you can call I haven't figured out what is causing this error. When using |
Fixed now in |
I'm still seeing the issue with vanilla-jsoneditor. "name": "vanilla-jsoneditor"
|
Thanks for testing with the latest version. I've tried to reproduce your issue but without success so far: https://jsbin.com/pufufol/edit?html,output Can you share more details? |
I added an update to the jsbin code and got the error.
|
I also tested with an initial value, incase it was related to using update without an initial value to start but had no luck. .update |
Thanks, I'll do further debugging. |
As a workaround you can, you can just not call |
This is the work around I'm using https://jsbin.com/desowehibi/1/edit?html,console,output I have an Angular component using the editor; so it's created in the component constructor and the data is set in an @input set function. So the workaround I'm using flows best in this scenario. |
It looks like the issue originates from the codemirror-wrapped-line-indent extension that we use, I've reported the issue there: fauzi9331/codemirror-wrapped-line-indent#1. |
This should be fixed now in |
Can confirm, not having the issue now with the latest update. Many thanks for the attention to this. |
Thanks for your feedback, good to hear! |
Hello jos,
Here is the minimal reproduction: https://github.com/cloydlau/reproduction.git
The text was updated successfully, but these errors were encountered: