AztecEditor-iOS icon indicating copy to clipboard operation
AztecEditor-iOS copied to clipboard

Add a button switch to toolbar for return (enter) behavior

Open 0nko opened this issue 7 years ago • 8 comments

There was a suggestion in the mobile requests to have a button switch in the toolbar for changing the line break behavior. Currently, the visual editor adds a large paragraph break on return. The button would switch the behavior to a regular single-space line break.

0nko avatar Apr 24 '17 07:04 0nko

Tagging as "Discussion" as it's not clear if we want this yet.

diegoreymendez avatar Jul 12 '17 13:07 diegoreymendez

Aztec already supports this behavior through the unicode line separator character \u2028. When a line separator is received, Aztec always adds a <br> regardless of context.

This means any client app can force this behavior by feeding Aztec line separators.

I'll leave this issue open, though, since we may want to add this button to the Example App toolbar.

diegoreymendez avatar Jul 12 '17 14:07 diegoreymendez

Ping @iamthomasbishop for input on this.

The keyboard offers support through SHIFT + ENTER. Do we want this feature in the toolbar?

diegoreymendez avatar Aug 11 '17 13:08 diegoreymendez

I'm not sure how I feel about adding a UI element for this. Isn't it typical behavior in editors for enter to perform a large/double break, and shift + enter to perform a small/single break? This is how Calypso works and I was thinking maybe this is how Aztec should work as well. Thoughts @diegoreymendez?

iamthomasbishop avatar Aug 12 '17 00:08 iamthomasbishop

The problem is if you don't have a hardware keyboard. You can have it only one way.

0nko avatar Aug 12 '17 10:08 0nko

@iamthomasbishop - The double enter vs single enter is an HTML-mode feature. Shift + Enter is the equivalent in visual mode (even in Calypso).

diegoreymendez avatar Aug 12 '17 18:08 diegoreymendez

Just for context, it's not possible to achieve this behavior using shift + enter with the virtual keyboard. We'll definitely need an external button like the one suggested in this issue.

diegoreymendez avatar Mar 28 '18 16:03 diegoreymendez

Aztec already supports this behavior through the unicode line separator character \u2028. When a line separator is received, Aztec always adds a <br> regardless of context.

This means any client app can force this behavior by feeding Aztec line separators.

I'll leave this issue open, though, since we may want to add this button to the Example App toolbar.

I would be extremely happy about an option to use line breaks instead of paragraphs. Unfortunately using \u2028 causes problems working with lists.

tipa avatar Oct 16 '20 05:10 tipa