#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)
Change History (14)
Changed 17 years ago by
Attachment: | fckconfig.js added |
---|
comment:1 Changed 17 years ago by
Keywords: | Pending added; StartupFocus Focus IE removed |
---|
comment:2 Changed 17 years ago by
Milestone: | FCKeditor 2.6 |
---|
comment:3 Changed 17 years ago by
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 17 years ago by
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 17 years ago by
Component: | Server : ColdFusion → General |
---|---|
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 17 years ago by
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 17 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
Changed 17 years ago by
Attachment: | 1764.patch added |
---|
comment:8 Changed 17 years ago by
Keywords: | Review? added |
---|
comment:9 Changed 17 years ago by
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 17 years ago by
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 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [1964].
Click here for more info about our SVN system.
Configuration file