#17225 closed defect (fixed)
Dialog: InlineEditBox with autosave=true and editor=dijit/Editor closes instantly
Reported by: | Christoph Zwerschke | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9.1 |
Component: | Dijit | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
This problem appeared in Dojo 1.9.0, it used to work before in Dojo 1.8.1:
When you create more than one InlineEditBox? based on the rich text Editor with autosave=true in a Dialogbox, then all but the first editor will not work. The problem is that if you click the text to be edited, the editor pops up and then immediately closes again. The reason for that seems to be that clicking the text focuses the editor, but there is some code in the focus method that does not work properly and makes the editor lose focus again which causes an onBlur event which closes the editor again. You can use the attached test_InlineEditBox2.html file to reproduce the problem. I have attached a small patch that fixes the issue for me, but I'm not sure if this could break other usages of InlineEditBox?.
Attachments (2)
Change History (6)
Changed 8 years ago by
Attachment: | test_InlineEditBox2.html added |
---|
Changed 8 years ago by
Attachment: | InlineEditBox.js.patch added |
---|
Patch that solves this issue for me in Dojo 1.9
comment:1 Changed 8 years ago by
Milestone: | tbd → 1.9.1 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Summary: | InlineEditBox: dijit/Editor with autosave=true in Dialog doesn't work → Dialog: InlineEditBox with autosave=true and editor=dijit/Editor closes instantly |
That's an interesting one.
It's from the code in 49339a0685729c69df92e91138788a6b50cdf2ef, which mistakenly thinks that the Dialog lost focus, and refocuses the first thing in the dialog. So the first InlineEditBox? is focused, thus causing the second one (which is in edit mode, showing the Editor) to close.
The reason the first InlineEditBox? works is that the action of "refocus the first thing in the Dialog" is a no-op when the first thing in the Dialog already has focus.
The code from 49339a0685729c69df92e91138788a6b50cdf2ef gets confused by the Editor's iframe. Probably it should just punt when it sees that focus has been moved to an iframe, or else do something fancy like focus.js does to trace past the iframe:
node=winUtils.get(node.ownerDocument).frameElement;
comment:2 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 8 years ago by
Thanks for looking into this and fixing it so quickly, Bill!
I can confirm that it now works properly even when the rich text editors are nested in a tab container in the dialog.
Test case for this ticket, can run in dijit/tests