Ticket #1764 (closed Bug: fixed)
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
Change History
Changed 5 years ago by randall
- Attachment fckconfig.js added
comment:3 Changed 5 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 5 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 5 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 5 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:
- The padding node listener found the document to be empty, and added a <p> or <div> automatically to conform to the EnterMode setting.
- The padding node listener then moved the caret into the newly added block element.
- But moving the caret means the editor would be focused as well.
comment:7 Changed 5 years ago by martinkou
- Owner set to martinkou
- Status changed from new to assigned
comment:9 Changed 5 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 5 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 5 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 5 years ago by mcleod@…
I can confirm that the fix works for IE7 on a LAMP environment.

Configuration file