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

<br/> is not added when I press enter in the editor! #1349

Open HakanSungur opened 1 year ago

HakanSungur commented 1 year ago

...< br/ > is not added when I press enter in the editor! My editor code <div> <Editor handlePastedText={() => false} editorStyle={{ height: 200, margin: 6, padding: 0, borderRadius: "2px", }} toolbar={{ options: [ "inline", "blockType", "fontSize", "list", "textAlign", "history", "emoji", ], inline: { inDropdown: false, }, list: { inDropdown: false }, textAlign: { inDropdown: false }, link: { inDropdown: false }, history: { inDropdown: false }, }} placeholder="..." editorState={editorState3} onEditorStateChange={setEditorState3} wrapperClassName=" block w-full text-neutral-500 dark:text-neutral-400 rounded-2xl border-neutral-200 focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 bg-white dark:border-neutral-700 dark:focus:ring-primary-6000 dark:focus:ring-opacity-25 dark:bg-neutral-800" editorClassName="ml-4 mb-2" toolbarClassName="block text-neutral-500 dark:text-neutral-400 w-full text-sm rounded-2xl border-neutral-200 focus:border-primary-300 focus:ring focus:ring-primary-200 focus:ring-opacity-50 bg-white dark:border-neutral-700 dark:focus:ring-primary-6000 dark:focus:ring-opacity-25 dark:bg-neutral-900" /> </div>

DKey96 commented 1 year ago

@HakanSungur I found out this is also an issue with the 'draftjs-to-html,' which is a dependency for this, that has been untouched since 2019. If you use Shift + Enter, it will give you
, without a shift its