Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#1764 closed Bug (fixed)

StartupFocus is false but FCKEditor steals focus anyway in IE

Reported by: Chris Randall Owned by: Martin Kou
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.5.1
Keywords: Confirmed IE Review+ Cc:

Description

I use IE and I have 2 editor windows loading. The first window has initial data where value is set to the text and the second window doesn't have data where value is set to . Focus is placed on the second window even when StartupFocus = False; Removing the second instance and setting the value on the first window to will also show that focus is taken.

Example Code: <cfset fckEditor = createObject("component", "fckeditor.fckeditor") /> <cfset fckEditor.basePath="/fckeditor/" /> <cfset fckEditor.toolbarSet = "OMC" /> <cfset fckEditor.value = 'Test with data' /> <cfset fckEditor.width="570" /> <cfset fckEditor.height="200" /> <cfset fckEditor.instanceName="Box1" /> <cfset fckEditor.FillEmptyBlocks = false /> <CFOUTPUT>#fckEditor.create()#</CFOUTPUT>

<cfset fckEditor.instanceName="Box2" /> <cfset fckEditor.value = /> <cfset fckEditor.height="100" /> <CFOUTPUT>#fckEditor.create()#</CFOUTPUT>

This is my first time submitting a ticket and will try to include my fckconfig.js file. PS. My paths above are different for my local test environment.

Attachments (2)

fckconfig.js (12.9 KB) - added by Chris Randall 10 years ago.
Configuration file
1764.patch (1.6 KB) - added by Martin Kou 10 years ago.

Download all attachments as: .zip

Change History (14)

Changed 10 years ago by Chris Randall

Attachment: fckconfig.js added

Configuration file

comment:1 Changed 10 years ago by Wojciech Olchawa

Keywords: Pending added; StartupFocus Focus IE removed

comment:2 Changed 10 years ago by Alfonso Martínez de Lizarrondo

Milestone: FCKeditor 2.6

comment:3 Changed 10 years ago by Bart McLeod

I have the same error. Server: LAMP. Browser: IE7. I would like to fix it, so maybe it can be assigned to me?

comment:4 Changed 10 years ago by Bart McLeod

In addition to my previous comment: StartupFocus = false DOES work if the editor is not empty. If it contains some text it will not claim or steel focus.

comment:5 Changed 10 years ago by Martin Kou

Component: Server : ColdFusionGeneral
Keywords: Confirmed IE added; Pending removed

I was able to reproduce it in a remote website with IE6 and IE7. So there's definitely a bug here.

comment:6 Changed 10 years ago by Martin Kou

The culprit to this bug is found to be the following three lines in fck.js, inside the function _FCK_PaddingNodeListener():

	range.select() ;
	if ( clearContents )
		range.pasteHTML( '' ) ;

What happened was this:

  1. The padding node listener found the document to be empty, and added a <p> or <div> automatically to conform to the EnterMode setting.
  2. The padding node listener then moved the caret into the newly added block element.
  3. But moving the caret means the editor would be focused as well.

comment:7 Changed 10 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

Changed 10 years ago by Martin Kou

Attachment: 1764.patch added

comment:8 Changed 10 years ago by Martin Kou

Keywords: Review? added

comment:9 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

I was not able to fully reproduce the problem, but the code change makes sense. If Martin confirms it, go ahead committing.

comment:10 Changed 10 years ago by Martin Kou

I can't post the test case for this bug because the test case I used comes from one of our commercial support customers. But I can confirm the problem exists in their site and I've tested for the effectiveness of my patch on their site.

comment:11 Changed 10 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1964].

Click here for more info about our SVN system.

comment:12 Changed 10 years ago by Bart McLeod

I can confirm that the fix works for IE7 on a LAMP environment.

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