Reproduction Steps:
1. Load up https://btheado.github.io/jsoneditor.html2. Go to the "Degenerate case: no schema specified" example
3. Change the root to "array" and add 1 item.
4. Set the first array item to type "boolean".
5. Set the first array item to type "number".
6. Set the first array item to type "boolean".
Observed Results:
Step 4: The schema at the bottom reads `[false]`, but the UI item renders `null`.
Step 5: The schema at the bottom reads `[""]`, and the UI item renders correctly.
Step 6: The schema at the bottom reads `[false]`, but the UI item renders `null`.
Best I could tell from the symptoms, there is something going on where the editor widget confirms the edit and writes the JSON. This triggers TW's refresh mechanism. When it gets to your `JSONEditorWidget.prototype.refresh` function it detects that the SCHEMA value of the options has changed, which triggers `this.refreshSelf();`. This appears to trigger TW's refresh cycle again, causing the selected option to be written - but the UI is using the previous version of the schema.
Really weird case. I'm going to read through the guts of JSONEditor's core.js file and also the "./editors/*" functions to see if we can get it to spawn native TW input widgets (which will automatically handle writing the data to the target for you with the TW input mechanism), and disable JSONEditor's internal refresh mechanism. We'll see how that goes...
Best,
Joshua F