Opened 5 years ago

Closed 5 years ago

#7912 closed Bug (fixed)

Enter key does not work properly

Reported by: lynne_kues Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.2
Component: UI : Enter Key Version: 3.0
Keywords: IBM Cc: satya_minnekanti@…

Description (last modified by fredck)

IE8

  1. Load this HTML:
<p>test test<span style="display: none">&nbsp;</span></p>
<p>and this is some more text</p>
<p>test<span style="display: none">&nbsp;&nbsp;&nbsp; </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
  1. Put cursor at end of third line of text by clicking the mouse.
  2. Press Enter key.

Nothing happens. The cursor does not go to the next line.

Attachments (2)

7912.patch (737 bytes) - added by garry.yao 5 years ago.
7912_2.patch (3.6 KB) - added by garry.yao 5 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 5 years ago by j.swiderski

  • Status changed from new to confirmed
  • Summary changed from IE - Enter key does not work properly to Enter key does not work properly
  • Version changed from 3.4.2 to 3.0

This only affects wysiwyg mode but when you switch to source everything is as it should be.

On IE8 and IE9 new paragraphs are added but the cursor doesn't move.

On FF new paragraphs are added but the cursor doesn't move or disappears.

On Webkit if you place the cursor at the end of first line (behind test test) and press enter, cursor will move to second line although new paragraph was made (see the source)

On Opera pressing enter ,when placing cursor behind third or first line, moves the cursor to the beginning of the text.

This has been true from CKEditor 3.0

comment:2 Changed 5 years ago by satya

  • Cc satya_minnekanti@… added

comment:3 Changed 5 years ago by lynne_kues

This is very confusing behavior for our customers. It's not apparent that new lines are being added and it appears that you can't add text to the end of the document.

comment:4 Changed 5 years ago by typeof

It also affects arrow keys. E.g. in the above scenario try pressing the left arrow key instead of enter - we have to actually press it 5 times in order to move the caret one character to the left. And then try to go to the next line using the right arrow key :)

Looks like IE traverses through invisible content (diplay:none) just like through regular one. We can even freely modify this content - if we are "inside of" an invisible element then we can type anything and it'll be changed (we can verify this behavior by switching later to the source view).

A solution for this problem would probably require adjusting caret position, so that it will never be inside of invisible element.

Changed 5 years ago by garry.yao

comment:5 Changed 5 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from confirmed to review

comment:7 Changed 5 years ago by fredck

  • Description modified (diff)

comment:8 in reply to: ↑ 6 Changed 5 years ago by fredck

Replying to garry.yao:

http://ckeditor.t/tt/7912/1.html

This test is passing to me in both IE8 and IE9 without patch.

comment:9 Changed 5 years ago by fredck

  • Status changed from review to review_failed

The patch is making no difference to me.

Changed 5 years ago by garry.yao

comment:10 Changed 5 years ago by garry.yao

  • Component changed from General to UI : Enter Key
  • Status changed from review_failed to review

comment:11 Changed 5 years ago by garry.yao

Unfortunately due to an selection system bug in Opera, which prevents us from making the following selection, we're not able to resolve the issue in that browser, new ticket would be opened to track it.

// The following selection is never possible in Opera, browser will redirect cursor to the paragraph above it.
<p>^<span style="display:none">text</span></p>

comment:12 follow-up: Changed 5 years ago by fredck

  • Status changed from review to review_failed

We're almost there, but the test is still failing with IE9/Compat. http://ckeditor.t/tt/7912/1.html

It passes with IE9 mode and IE8.

comment:13 Changed 5 years ago by fredck

Additionally, this one fails with FF4: http://ckeditor.t/tt/4781/1.html

comment:14 in reply to: ↑ 12 Changed 5 years ago by garry.yao

  • Status changed from review_failed to review

Replying to fredck:

but the test is still failing with IE9/Compat.

http://ckeditor.t/tt/7912/1.html

IE < 8 doesn't really hide display:none elements thus are free of this bug, excluded from TC now.

Additionally, this one fails with FF4: http://ckeditor.t/tt/4781/1.html

It should be caused by outdated ticket branch, WFM after merged from master.

comment:15 Changed 5 years ago by fredck

  • Milestone set to CKEditor 3.6.2
  • Status changed from review to review_passed

comment:16 Changed 5 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7242].

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy