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

Why is there an uneeded <div>?

Open DanielHabenicht opened this issue 4 years ago • 2 comments

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?

DanielHabenicht avatar Mar 09 '21 21:03 DanielHabenicht

+1

stevegg avatar May 28 '21 04:05 stevegg

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.

matburnham avatar Jul 29 '21 12:07 matburnham