jdorn / json-editor

JSON Schema Based Editor
MIT License
5.81k stars 1.08k forks source link

Problem with SCEditor and Object Properties #651

Open brettz9 opened 8 years ago

brettz9 commented 8 years ago

I have noticed a long-standing problem that adding an "Object Properties" property will cause SCEditor to no longer accept input.

Also, perhaps unrelated, I'm getting many errors on load after this line 437 of src/lib/SCEditor.js:

doc = getWysiwygDoc();
doc.open(); // doc is undefined
f-w commented 6 years ago

Root cause is SCEditor uses iframe and json-editor moves field DOM subtrees during object property change to accommodate property ordering. Content inside iframe is lost during the move due to iframe sandbox scoping constraint. A workaround is switching to summernote with my working fork based on pr #440, which contains some bugs perhaps due to relying on an older version of summernote api. Related discussion on so