Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1033 closed Bug (fixed)

Unable to apply formatting to selection

Reported by: Jon Håvard Gundersen Owned by: Martin Kou
Priority: Must have (possibly next milestone) Milestone: FCKeditor 2.5 Beta
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Confirmed IE Cc:

Description

Whenever I have selected a text and tries to apply a formatting (bold/italic/font etc) the selection is collapsed and the formatting is not applied to the selected text.

Verfied with IE7 in nightly build.

Change History (12)

comment:1 Changed 12 years ago by Jon Håvard Gundersen

Sorry about the missing word in the heading, should be: Unable to apply formatting to selection.

Also I noticed that if you have no selection and the cursor is inside a word the current word is formatted.

comment:2 Changed 12 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.5
Owner: set to Martin Kou
Summary: Unable to formatting to selectionUnable to apply formatting to selection
Version: SVN

I have the impression that the selection is being lost when saving the undo snapshot, resulting in a collapsed selection.

comment:3 Changed 12 years ago by Frederico Caldeira Knabben

Keywords: Confirmed IE added

comment:4 Changed 12 years ago by Martin Kou

I've tried disabling the save snapshot logic and the bug still occurred. A lot of strange bugs have been discovered regarding selections in IE recently.

This bug could be related to #1034, and perhaps #1026 and #1005 as well.

comment:5 Changed 12 years ago by Jon Håvard Gundersen

I've found the problem, we introduced the bug with the "kludge" in #141 with [608], we need to make sure that the range/position is only set at startup.

comment:6 Changed 12 years ago by Frederico Caldeira Knabben

Confirmed. I had the same findings here. The buggy point is FCK.Focus() as it make changes to the selection.

Most probably, the code added with [608] should move outside the Focus() function, to the point where the StartupFocus is executed.

comment:7 Changed 12 years ago by Jon Håvard Gundersen

Yes, it seems to working ok, both correct position after startup and no more collapsing selections if

var range = FCK.EditorDocument.selection.createRange() ; range.moveEnd( "character", 1 ) ; range.select() ; range.collapse( true ) ; range.select() ;

is moved to FCK.SetStaus

comment:8 Changed 12 years ago by Martin Kou

Resolution: fixed
Status: newclosed

It works wonderfully, thanks a lot.

I've committed the suggested fix as [620].

comment:9 Changed 12 years ago by Martin Kou

Resolution: fixed
Status: closedreopened

Oh, no, it's not fixed yet. There's still one more problem in IE:

  1. Open sample01.html.
  2. Copy some text from notepad or whatever source you like.
  3. Press the "Source" button twice.
  4. The cursor should be inside the editing area.
  5. Press Ctrl-V.
  6. Nothing is pasted.
  7. Click on the editing area.
  8. Paste operation successful.

So the bug from #141 is back with this fix.

comment:10 Changed 12 years ago by Jon Håvard Gundersen

I guess that means we have to reopen #141 and close this one :)

comment:11 Changed 12 years ago by Martin Kou

Resolution: fixed
Status: reopenedclosed

Fixed with [621].

I've moved the kludge code into FCKEditingArea.prototype.MakeEditable(), and now it works fine for all test cases that I have.

comment:12 Changed 12 years ago by Frederico Caldeira Knabben

After further analysis, we found out that the kludge must be inside Focus() to make it work on all cases. I've made a small change to it with [623] which seams to be ok with this ticket too, so it should be the definitive solution for #141 and this one.

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