Opened 9 years ago

Closed 9 years ago

#2469 closed Bug (fixed)

FCK.SetData() causes editor to become temporarily non-focusable in IE7.

Reported by: Martin Kou Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.4
Component: General Version: FCKeditor 2.6.3
Keywords: Confirmed IE7 Review+ Cc:

Description

This bug was originally reported by Mathias-S in our IRC channel. To reproduce the bug:

  1. Add the following HTML code to sample11_frame.html right after the submit button's HTML code.
    <script type="text/javascript"><!--
    function SetContents()
    {
    	// Get the editor instance that we want to interact with.
    	var oEditor = FCKeditorAPI.GetInstance('FCKeditor_1') ;
    
    	// Set the editor contents (replace the actual one).
    	oEditor.SetData( 'This is the <b>new content<\/b> I want in the editor.' ) ;
    }
    //-->
    </script>
    <input type="button" value="Set Editor Contents" onclick="SetContents();" />
    
  2. Open sample11.html in IE7.
  3. Type some random characters into FCKeditor 1.
  4. Select the just added characters with some of the previously existing text in FCKeditor 1.
  5. Click on the empty space between FCKeditor 1 and FCKeditor 2.
  6. Click "Set Editor Contents".
  7. Try to put the focus back on FCKeditor 1 by clicking it - it doesn't work. If it does, refresh the page and try again.

According to Mathias-S's original report, the bug can be reproduced in IE6 as well. But I wasn't able to do that in IE6.

Attachments (2)

2469.patch (1.3 KB) - added by Martin Kou 9 years ago.
2469_2.patch (1.3 KB) - added by Martin Kou 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by Martin Kou

Resolution: fixed
Status: newclosed

Fixed with [2361].

Click here for more info about our SVN system.

comment:2 Changed 9 years ago by Martin Kou

Resolution: fixed
Status: closedreopened

Oops... wrong ticket.

Changed 9 years ago by Martin Kou

Attachment: 2469.patch added

comment:3 Changed 9 years ago by Martin Kou

Keywords: Review? added

comment:4 Changed 9 years ago by Alfonso Martínez de Lizarrondo

The patch seems to work (at least from my understanding of the bug, although it's hard to notice it), but I think that whenever SetData is called, the stored selection should be reset, it can't be safely restored back because those nodes no longer exist, so I would add a call to FCKSelection.Release() in FCK.SetData() like the call to FCKTempBin.Reset();

comment:5 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review- added; Review? removed

Sorry, retesting to verify if #2496 works or not I've found that this patch does break at least that situation and it forces the insertion at the start of the content again.

To verify apply first #2496 and verify that the paste dialogs work correctly, then apply this patch (clear cache) and test again. For me it does fail.

Changed 9 years ago by Martin Kou

Attachment: 2469_2.patch added

comment:6 Changed 9 years ago by Martin Kou

Keywords: Review? added; Review- removed

Looks like there's no other way then. I'm adding a FCK.Selection.Release() to FCK.SetData() as suggested and it solves both this bug and #2496.

comment:7 Changed 9 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:8 Changed 9 years ago by Martin Kou

Resolution: fixed
Status: reopenedclosed

Fixed with [2599].

Click here for more info about our SVN system.

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