#1018 closed defect (fixed)
Multiple Editor2 instances do not work properly in Firefox
Reported by: | liucougar | Owned by: | liucougar |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | [email protected]…, [email protected]… | |
Blocked By: | Blocking: |
Description
in http://archive.dojotoolkit.org/nightly/tests/widget/test_Editor2.html, try select some text in the first instance of the Editor2, click "bold" button: no effect!
While select some text in the second instance, it works fine
After investigation, I think the issue is caused by the fact that this.EditNode? is not initialized when these codes are executed:
dojo.event.topic.registerPublisher("Editor2.clobberFocus", this.editNode, "onfocus"); dojo.event.topic.subscribe("Editor2.clobberFocus", this, "setBlur"); dojo.event.connect(this.editNode, "onfocus", this, "setFocus");
However, I tried several approaches to workaround this with no success. Any clues?
Attachments (1)
Change History (6)
comment:1 Changed 15 years ago by
Owner: | changed from anonymous to liucougar |
---|
comment:2 Changed 15 years ago by
Status: | new → assigned |
---|
(sorry, the format in the previous comment seems messed up, repost it here)
So dojo.event.connect won't work anymore. Attached is a patch to rectify this:
an global variable, dojo.widget.html._CurrentEditor2Instance, is introduced to save the current focused editor2 instance (this is required for Firefox as it generates a onfocus event for every click in the editing area)
Editor2 overload onFocus() in RichText? widget now to handle setFocus correctly some Useless codes are removed as well
I also tested this patch against IE without noticable issues (I have to remove 'useActiveX="true"' in the first instance to load the page)
Changed 15 years ago by
Attachment: | 1018.patch added |
---|
comment:4 Changed 15 years ago by
Milestone: | → 0.4 |
---|
Finally, I think I solved it:
Just moving the editorOnLoad() to a later stage when this.EditNode? is set correctly won't solve this: in firefox, browser specific features are used to handle onFocus event in RichText?:
So dojo.event.connect won't work anymore. Attached is a patch to rectify this: an global variable, dojo.widget.html._CurrentEditor2Instance, is introduced to save the current focused editor2 instance (this is required for Firefox as it generates a onfocus event for every click in the editing area) Editor2 overload onFocus() in RichText? now to handle setFocus correctly some Useless codes are removed as well
I also tested this patch against IE without noticable issues (I have to remove 'useActiveX="true"' in the first instance to load the page)