Ticket #1764 (closed Bug: fixed)

Opened 7 months ago

Last modified 3 months ago

StartupFocus is false but FCKEditor steals focus anyway in IE

Reported by: randall Owned by: martinkou
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

fckconfig.js (12.9 kB) - added by randall 7 months ago.
Configuration file
1764.patch (1.6 kB) - added by martinkou 4 months ago.

Change History

Changed 7 months ago by randall

Configuration file

Changed 7 months ago by w.olchawa

  • keywords Pending added; StartupFocus Focus IE removed

Changed 7 months ago by alfonsoml

  • milestone deleted

Changed 5 months ago by mcleod@…

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

Changed 5 months ago by 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.

Changed 4 months ago by martinkou

  • keywords Confirmed IE added; Pending removed
  • component changed from Server : ColdFusion to General

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

Changed 4 months ago by martinkou

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.

Changed 4 months ago by martinkou

  • owner set to martinkou
  • status changed from new to assigned

Changed 4 months ago by martinkou

Changed 4 months ago by martinkou

  • keywords Review? added

Changed 4 months ago by fredck

  • 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.

Changed 4 months ago by martinkou

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.

Changed 4 months ago by martinkou

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [1964].

Click here for more info about our SVN system.

Changed 3 months ago by mcleod@…

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

Note: See TracTickets for help on using tickets.