jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.38k stars 1.15k forks source link

Why previewImage Upload not fit to box ? #856

Open paoonline opened 4 years ago

paoonline commented 4 years ago

My Code

<Editor
          editorState={editorState}
          wrapperClassName="demo-wrapper"
          editorClassName="demo-editor"
          editorStyle={EditorStyle}
          onEditorStateChange={editor && this.onEditorStateChange}
          toolbarStyle={ToolbarStyle}
          toolbar={{
            options: ['inline', 'image', 'list', 'textAlign', 'history'],
            inline: {
              options: ['bold', 'italic', 'underline', 'strikethrough', 'monospace'],
            },
            image: {
              previewImage: true, uploadCallback: uploadImageCallBack, alt: { present: true, mandatory: true }
            },
          }}
        /> :
lhxatus commented 4 years ago

I had the same issue, an easy fix is change its style

.rdw-image-modal-upload-option-label>img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}