Opened 16 years ago

Closed 16 years ago

#2531 closed Bug (fixed)

Scroll Into View Bug When Breaking Large Content (FF)

Reported by: Davey Shafik Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: FCKeditor 2.6.4
Component: General Version: FCKeditor 2.6.3
Keywords: Confirmed Firefox Review+ Cc:

Description

If you paste a large amount into the editor, where you end up with:

<p> some large text <br /> paragraphs aren't there anymore </p>

And you wish to put the paragraphs in to make it look like:

<p> some large text </p> <p> paragraphs aren't there anymore </p>

It will scroll the end of the second paragraph into view, which when the end is far enough away, will push the cursor off-screen, which can be confusing (why did I jump to the bottom?).

If you continue to type, it'll start typing where the cursor is, not where the eye is, scrolling that back into view.

The lines that cause the issue are fckenterkey.js lines 538/539:

source:FCKeditor/trunk/editor/_source/classes/fckenterkey.js@2136#L538

I initially just commented this out, but then when you want to put in a new paragraph at the end, it will not scroll that into view.

It seems to me that it should scroll when the paragraph is empty, but not otherwise, adding a FCKDomTools.CheckIsEmptyElement() will not work however, as we actually have:

<p> <br _moz_dirty=""> <br type="moz"> </p>

Some changes to the CheckIsEmptyElement() however will solve this (see patch).

This does not completely solve the issue. When pressing enter with an "empty" paragraph being add, it will work fine. When pressing enter with a non-empty paragraph following, it works fine so long as it's not at the bottom of the view area, because then it doesn't scroll and should.

This is a little better, but not complete. The best solution would be to move to the top of the paragraph, not the bottom. Is this possible?

  • Davey

Attachments (2)

fix_enterkey.patch (1.6 KB) - added by Davey Shafik 16 years ago.
Patch to partially fix enter key with following content odd movement
2531.patch (1.7 KB) - added by Frederico Caldeira Knabben 16 years ago.

Download all attachments as: .zip

Change History (9)

Changed 16 years ago by Davey Shafik

Attachment: fix_enterkey.patch added

Patch to partially fix enter key with following content odd movement

comment:1 Changed 16 years ago by Artur Formella

Keywords: Pending added

Could you try it with current version? It seems to be fixed. http://www.fckeditor.net/demo

comment:2 Changed 16 years ago by Davey Shafik

This bug was reported against, and still exists in 2.6.3, as well as the latest revision (r2400)

comment:3 Changed 16 years ago by Artur Formella

Keywords: WorksForMe added

I'm still not able to reproduce this bug in latest version. Please write more details.

comment:4 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Confirmed Firefox added; Pending WorksForMe removed
Version: FCKeditor 2.6.3

Confirmed with FF3.

Changed 16 years ago by Frederico Caldeira Knabben

Attachment: 2531.patch added

comment:5 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review? added
Milestone: FCKeditor 2.6.4
Owner: set to Frederico Caldeira Knabben
Status: newassigned

comment:6 Changed 16 years ago by Martin Kou

Keywords: Review+ added; Review? removed

Tested the new patch on Opera, Safari and Firefox 3. Works like a charm.

comment:7 Changed 16 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

Fixed with [2565].

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