Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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)

test_InlineEditBox2.html (2.2 KB) - added by Christoph Zwerschke 6 years ago.
Test case for this ticket, can run in dijit/tests
InlineEditBox.js.patch (741 bytes) - added by Christoph Zwerschke 6 years ago.
Patch that solves this issue for me in Dojo 1.9

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Christoph Zwerschke

Attachment: test_InlineEditBox2.html added

Test case for this ticket, can run in dijit/tests

Changed 6 years ago by Christoph Zwerschke

Attachment: InlineEditBox.js.patch added

Patch that solves this issue for me in Dojo 1.9

comment:1 Changed 6 years ago by bill

Milestone: tbd1.9.1
Owner: set to bill
Status: newassigned
Summary: InlineEditBox: dijit/Editor with autosave=true in Dialog doesn't workDialog: 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 6 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In 2324a2290b40983e8399d3d6d639e9f560eb6a5e/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:3 Changed 6 years ago by Bill Keese <bill@…>

In 2341c812b14bb1a246b874836aed3e3f2e337347/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 6 years ago by Christoph Zwerschke

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.

Note: See TracTickets for help on using tickets.