facebookarchive / draft-js

A React framework for building text editors.
https://draftjs.org/
MIT License
22.56k stars 2.64k forks source link

How do I set the image default width and height of an image? #3153

Open sparkmediatech opened 1 year ago

sparkmediatech commented 1 year ago

I am using @draft-js-plugins/image plugin and @draft-js-plugins/editor to display contents created with react-draft-wysiwyg. The @draft-js-plugins/image plugin is to display image inside the @draft-js-plugins/editor. The problem I have now is that I want to have a set default image size for the image. It is not picking the size coming from the react-draft-wysiwyg when the image was uploaded. I am new to this. How can I solve this?

rajeshbjgowda commented 1 year ago

have u got solution ?

sparkmediatech commented 1 year ago

I simply mentioned the name of the div that is housing the editor and called the img tag in css and styled it. It worked. For instance, if I have the editor inside this div called 'readOnlyEditor-div'. I simply go to css and do this: .readOnlyEditor-div img{ width:; height : ; }

etc.