Ticket #1764 (closed Bug: fixed)

Opened 7 years ago

Last modified 5 years 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 years ago.
Configuration file
1764.patch (1.6 KB) - added by martinkou 6 years ago.

Change History

Changed 7 years ago by randall

Configuration file

comment:1 Changed 7 years ago by w.olchawa

  • Keywords Pending added; StartupFocus Focus IE removed

comment:2 Changed 7 years ago by alfonsoml

  • Milestone FCKeditor 2.6 deleted

comment:3 Changed 6 years 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?

comment:4 Changed 6 years 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.

comment:5 Changed 6 years 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.

comment:6 Changed 6 years 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.

comment:7 Changed 6 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

Changed 6 years ago by martinkou

comment:8 Changed 6 years ago by martinkou

  • Keywords Review? added

comment:9 Changed 6 years 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.

comment:10 Changed 6 years 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.

comment:11 Changed 6 years 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.

comment:12 Changed 6 years ago by mcleod@…

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

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