Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1121 closed Bug (fixed)

Scrolling does not work properly with the new Enter Key handler code

Reported by: gboissiere Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version:
Keywords: Confirmed Firefox Cc:

Description

This issue seems to be Firefox specific. The bug seems to be in the FCKEnterKey class although I could not figure out how to fix it.

To reproduce (very easy):

  • download the latest nightly built (or version 2.4.3)
  • edit fckconfig.js and replace: FCKConfig.EnterMode = 'p' ; by FCKConfig.EnterMode = 'br' ;
  • Load the _samples/default.html page into Firefox
  • Now keep pressing the enter key until the cursor goes down enough to create a scrollbar

What you will see: You will notice that the scrollbar does not go down and follow the cursor as expected. So the cursor becomes no longer visible.

What should happen instead: The scrollbar should scroll down and the cursor should still be visible.

NOTE: Type any character (other than Enter) and the scrollbar will work fine, which seem to point to a bug in the Enter Key handler code

Change History (9)

comment:1 Changed 9 years ago by martinkou

  • Keywords Confirmed Firefox added

comment:2 Changed 9 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

The problem also occurs in Safari, Opera.

And, it also occurs for Shift-Enter (when shift-enter is set to <br>), and Enter inside <pre> blocks (all EnterMode settings).

comment:3 Changed 9 years ago by martinkou

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

Fixed with [745].

Click here for more info about our SVN system.

comment:4 Changed 9 years ago by gboissiere

  • Resolution fixed deleted
  • Status changed from closed to reopened

Sorry to bring some bad news, but the fix to this issue creates some other problems.

To reproduce the problem created by this patch (very easy):

  • Load the sample 10 in Firefox: _samples/html/sample10.html
  • Resize the browser window much smaller so that on the screen, you only see "Normal text field:" at the top and the FCKEditor1 textarea at the bottom
  • Put the cursor into FCKEditor1 field and type enter

What is expected: it places the cursor on the next line, and the scrollbars do not move.

What happens instead: the browser scrollbar "jumps" to the bottom and the cursor is now placed at the top of the page. The line of text above the cursor is no longer visible.

comment:5 Changed 9 years ago by gboissiere

The following code appears to fix the issue for me:

506 if ( ! FCKBrowserInfo.IsIE ) 507 { 508 var dummy = this.Window.document.createElement( 'br' ) ; 509 eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ; 510 dummy.scrollIntoView(false) ; 511 dummy.parentNode.removeChild( dummy ) ; 512 }

Can someone knowledgeable confirm that this fix is correct? Thanks a lot! Thanks!

comment:6 Changed 9 years ago by martinkou

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

Yes I've missed out the false argument to scrollIntoView(), which caused the scrollbar jump. Thanks for the report.

The issue is fixed in [751].

comment:7 Changed 9 years ago by gboissiere

  • Resolution fixed deleted
  • Status changed from closed to reopened

This does not work for me unless we also replace:

var dummy = this.Window.document.createElement( 'span' ) ;

by

var dummy = this.Window.document.createElement( 'br' ) ;

Using 'span', the cursor becomes invisible if you press ENTER 10 times in a row.

comment:8 Changed 9 years ago by martinkou

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

The problem with br is that it does not work with Opera.

Let's try this, if it is Opera, we use span. If not, we use br. This should fix the disappearing caret problem as well as Opera's problem.

I've committed a new fix to [753].

comment:9 Changed 9 years ago by fredck

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