#1121 closed Bug (fixed)
Scrolling does not work properly with the new Enter Key handler code
Reported by: | gboissiere | Owned by: | Martin Kou |
---|---|---|---|
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 18 years ago by
Keywords: | Confirmed Firefox added |
---|
comment:2 Changed 18 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
comment:3 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [745].
Click here for more info about our SVN system.
comment:4 Changed 18 years ago by
Resolution: | fixed |
---|---|
Status: | closed → 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 18 years ago by
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 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → 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 18 years ago by
Resolution: | fixed |
---|---|
Status: | closed → 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 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → 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 18 years ago by
Milestone: | → FCKeditor 2.5 |
---|
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).