-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New block should reset inline styles #19
Comments
I don't think this is a bug, since the current behavior is what most users will expect. The Draft.js team at Facebook chose this behavior, since most text editors (such as Microsoft Word and Pages) use it as well. I suggest adding an optional |
I've found this is what some users expect but others expect the opposite. Especially with some inline styles, like code/monospace, users expect insertion of a new block to signify they are done writing that snippet of code. In my own research, I've found that editors who treat a return more like a line break (Word, Pages, Draft demo) do not tend to reset inline styles. But editors which have clear paragraph blocks, like Quip, give you a fresh start when you start a fresh block. When using Quip users find this behavior intuitive, but admittedly this is far less common than the MSWord behavior. It sounds reasonable to make an option for this, but I'd like, by default, to reset inline styles for a new block for a few reasons:
From a technical standpoint, I've checked into it and there are some complications that will make this a little difficult to solve. But I do think solving it is the right thing to do. |
I must say you make a compelling argument, and I personally find the reset on newline behavior preferable. FYI: There has been some discussion on this topic in the Draft.js repo as well, where somebody suggested using a |
If you set bold/italic/etc, type some text and then press enter to start a new paragraph, the style should be back to normal in the new block.
Thanks to @codesoda for noticing this bug.
The text was updated successfully, but these errors were encountered: