josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

Updating empty content returns parseError until edited manually #237

Closed kloon15 closed 1 year ago

kloon15 commented 1 year ago

I'm implementing an upload feature and i'm having the issue of 2 things that must be related:

  1. Update JSONEditor with a content of { text: "" }, and it returns unexpected end of data at line 1 column 1 in OnChangeStatus (this is understandable, its not a JSON indeed).
  2. Pasting a valid JSON to the editor will not clear the above parseError, only by manually editing.

This only happens with the empty content strangely.

image

josdejong commented 1 year ago

Thanks for reporting these bugs @kloon15

josdejong commented 1 year ago

Fixed in v0.16.0