svelte-jsoneditor icon indicating copy to clipboard operation
svelte-jsoneditor copied to clipboard

Parsing JSON with duplicate keys in onChange throws "RangeError: Selection points outside of document"

Open ZRui98 opened this issue 1 year ago • 10 comments

Hi, I ran into this with svelte + svelte-jsoneditor v0.17.9. When pasting in JSON with duplicate keys, this error from codemirror gets thrown: Uncaught (in promise) RangeError: Selection points outside of document. I noticed this started occurring on v0.17.9, but was not present on v0.17.8. Minimal example to reproduce: https://www.sveltelab.dev/8u8l783v8eij2b1 To reproduce, paste

{"a":"a", "a":"b"}

into the editor. An error should be thrown in the console log. Thanks.

ZRui98 avatar Oct 30 '23 04:10 ZRui98