Opened 10 years ago

Closed 10 years ago

#11784 closed Bug (expired)

forceEnterMode enabled, enter key does not work well inside lists

Reported by: Irina Owned by:
Priority: Normal Milestone:
Component: General Version: 4.3.5
Keywords: IBM Cc: Satya Minnekanti, Christophe Guillou


  1. Open enterkey.html CKEditor.
  2. Set enter mode to BR.
  3. Set forceEnterMode to true.
  4. Click bulleted/numbered list icon.
  5. Enter first line of text.
  6. Press enter key.
  7. Enter second line of text.

Problem: The second line of text is not a new list item.

	<li>line1<br />

Tested in FF, editor version 4.3.5, revision "a10440f"

This issue might be related to

Change History (5)

comment:1 Changed 10 years ago by Piotrek Koszuliński

I believe that this is exactly what 'forceEnterMode' means. That BR will be inserted regardless of context. Kuba, am I right?

comment:2 Changed 10 years ago by Jakub Ś

@Reinmar yes you are right but I really would like to hear Fred's opinion as this is quite interesting/strange case.

First the findings:

Without Force:
2DIVs or 2Ps - New list item is inserted always.
2BRs - Enter key inserts new element but Shift+Enter inserts BR.
IMHO This is expected behaviour although List Plugin or Enter Key logic might have been changed especially for this case.

With Force
2DIVs or 2Ps - New list item is inserted always.
2BRs - Only Brs are inserted. Although you can't create new list items anymore it looks logical again. You were able to insert new list items without Force and now you insert BRs no matter what.
On the other hand not being able to insert new list elements doesn't look good from user point of view.

NOTE: When you use Force and have enterMode set to BR but shiftEnterMode to P then you can insert new list items on Shift+Enter.

@irina could you tell us what is the real life use case here? Why do you need such settings?

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Status: newpending

The forceEnterMode feature has been designed especially for enter mode P. That's because by default, CKEditor tends to keep the current kind of block, so if you're inside a <div>, you'll be kept inside <div>. By forcing it, this will not happen so <p> is created instead.

The problem is that we also have enter mode BR and so people start abusing of forceEnterMode. I any case, it doesn't make much sense for the to have forceEnterMode when enter mode is BR, so the current workaround should be simply avoiding using forceEnterMode in this case. Wouldn't this be enough?

comment:4 Changed 10 years ago by Piotrek Koszuliński

I would also say that forceEnterMode is used by SHIFT+ENTER and that's how I understand this option. It can be explained like: "When you press SHIFT then forceEnterMode is being enabled."

How does it apply to this case? When you have a shiftEnterMode==BR and you press SHIFT+ENTER in a list item, you expect that <br> is inserted. So that how enterMode==BR works when forceEnterMode is enabled in the config. So if the intention is not to force enter mode, then it should not be used.

comment:5 Changed 10 years ago by Piotrek Koszuliński

Resolution: expired
Status: pendingclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy