# draftjs

[Solved] Draft js editor scrolls to bottom when pressing Enter/Return key

Recently I faced one weird issue on Draft js editor. The problem is when I press the Enter/Return key, the editor scrolls to the bottom of the page instead of creating a new block. Hmm, which is weird, right? After spending some time on debugging, I found out that the issue is happening because of some overflow conflict on the editor container.

So after setting "overflow: auto" to the root container of the editor (i,e) DraftEditor-root, the issue got solved. Below is the code that solved my issue,

.DraftEditor-root {
overflow: auto;
}

I hope someone will find this useful. Please let me know whether it worked for you or not. Thanks :-)

Discussions