Opened 10 years ago

Closed 10 years ago

#9632 closed defect (fixed)

Dialog: show() requires an element to have focus in IE

Reported by: nzCharlie Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.2
Keywords: dijit dialog show IE7 Cc:
Blocked By: Blocking:

Description

With IE 7, a javascript error (Access Denied) is raised on the line dijitDialog.show(). The page which contains the dijit.Dialog is in a frame.

the workaround is make sure an element on the page has focus before the show method is called. e.g.

if (dojo.isIE) {
  var button = dojo.byId('aButton');
  button.focus();
}

Please find the attached file for the use case that exhibits the problem.

Attachments (1)

test.zip (939 bytes) - added by nzCharlie 10 years ago.
test files contains the frame and html

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by nzCharlie

Attachment: test.zip added

test files contains the frame and html

comment:1 Changed 10 years ago by bill

Component: DojoX FormDijit
Milestone: tbd1.4
Owner: changed from dante to bill
Status: newassigned
Summary: dijit.Dialog.show() requires an element to has focus in IEDialog: show() requires an element to have focus in IE

Thanks for the test case. Looks like Dialog calls getFocus() which calls isCollapsed(), and then there's an exception because createRange() returns null.

Strange bug that it only happens with framesets.

comment:2 Changed 10 years ago by bill

Actually, createRange() is throwing an exception, not returning null.

comment:3 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [19338]) Avoid IE exception on getRange() call in obscure circumstances (when there's no selection and dojo is running from an iframe). Fixes #9632 !strict.

Note: See TracTickets for help on using tickets.