Skip to content
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

Conform to standard rich text editor / word processor behavior #1858

Closed
mor10 opened this issue Jul 11, 2017 · 6 comments
Closed

Conform to standard rich text editor / word processor behavior #1858

mor10 opened this issue Jul 11, 2017 · 6 comments
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable

Comments

@mor10
Copy link
Contributor

mor10 commented Jul 11, 2017

Issue Overview

When writing content in a word processor, certain behaviors are standard and expected. These need to be emulated in Gutenberg to avoid confusion from users who write and edit content in WordPress. A non-exhaustive list is provided below.

Expected Behavior

  • A single press of the Return key produces a new paragraph (block).
  • Pressing Shift+Return produces a line break.
  • Pressing Return twice breaks you out of a list (ordered or unordered)

Current Behavior

  • A single press of the Return key produces a line break.
  • Pressing Shift+Return produces a new paragraph (block).
  • Pressing Return twice creates a new paragraph (block).
  • Pressing Return twice in a list creates two empty list items.

Possible Solution

These behaviors are either opposite of or outside of standard expected behavior from a rich content editor, and also run counter to how the current content editor in WordPress works.

When writing and editing content, Gutenberg should behave like a standard word processor or rich content editor. Creating non-standard output causes the end-user to experience frustration and the perception that something is either wrong or the feature they are looking for does not exist.

@swissspidy
Copy link
Member

Pressing Return twice breaks you out of a list (ordered or unordered)

See #1482.

@mor10
Copy link
Contributor Author

mor10 commented Jul 11, 2017

Excellent. Then focus of this ticket can be shifted to line/paragraph breaks.

@mtias
Copy link
Member

mtias commented Jul 14, 2017

Thanks for the feedback. See #1078 for the initial switch to single line breaks on enter. This is something we wanted to test early on to see how it feels next to the notion of a block per paragraph—specially to those not familiar with the nuisances of line breaks, paragraph breaks, and the shift+enter behaviour.

Word processors are not extremely clear—in terms of visual perception—in how they handle line breaks. See example from Pages:

image

Both elements look the same to the user given default styles, yet one is a paragraph break and the other is a line break.

This often leads to users doing multiple paragraph breaks when they are not needed. At the same time, the usual expected behaviour above is counter intuitive with how the web handles default paragraph styles (with margins) compared to traditional book layouts or even email clients that generally do a single visual break on enter.

@mtias mtias added Design [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Jul 14, 2017
@mor10
Copy link
Contributor Author

mor10 commented Jul 14, 2017

I'm confused: right now it looks like hitting Return while inside a block produces a line break, as in <br>. Is this incorrect? If a single press of Return produces a new paragraph <p></p> element, this is not visually clear.

To clarify: When writing content in an editor, a single press of the Return key should produce a new paragraph element while Shift+Return should produce a line break tag. This is expected behavior and necessary to preserve proper semantic structure of the HTML document. How all of this relates to blocks is a separate conversation. I'm talking about the HTML output.

@mor10
Copy link
Contributor Author

mor10 commented Aug 1, 2017

This issue looks to have been resolved in #1989.

@karmatosed
Copy link
Member

As this issue has been resolved, closing - if it's not please let me know and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable
Projects
None yet
Development

No branches or pull requests

4 participants