vankop / jsoneditor-react

react wrapper implementation for https://github.com/josdejong/jsoneditor
MIT License
263 stars 106 forks source link

Why is there an uneeded <div>? #52

Open DanielHabenicht opened 3 years ago

DanielHabenicht commented 3 years ago

Hi! While trying to incorporate the editor into my application I came across this <div> wrapping the editor.

image It is set here https://github.com/vankop/jsoneditor-react/blob/dabd034a66603fab0c570b53633b89a0611d40f0/src/Editor.jsx#L210-L216

It seems rather unneeded and prevents the expansion of the Editor, which I think is not expected behaviour, implied by the CSS set on the jsoneditor class: image

I think the rogue div should be removed, what do you think?

stevegg commented 3 years ago

+1

matburnham commented 3 years ago

Had this problem too. Eventually figured I could set the class name and control it myself with:

<JsonEditor
  ...
  htmlElementProps={{className: 'jsoneditor-container'}}
/>

Or you can change the element type with the tag attribute.