Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15058 closed defect (fixed)

Dialog: focus.focus() error on page unload (IE6-8)

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.7.3
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

(reported by Stephan Hesmer)

See attached testcase. Click button to open dialog, and then click link in dialog, which navigates to a new page. IE gets an exception.

More Details:

When the page unloads, only IE runs a _destroyAll for the dijit.registry (which is to help prevent memory leaks). As it is destroying, the DialogLevelManager.hide inside the dijit Dialog.js is called, which attempts to call focus.focus() and this fails. Because it's trying to restore focus to the Button that triggered the Dialog, but that Button has already been destroyed.

Looking at dojo 1.6, the _DialogLevelManager used dijit.focus(focus) instead, and surrounded it in try/catch statements to discard the error when it occurs.

IMPORTANT: This issue only happens on IE7 and IE8 directly, not on IE9 in IE8 mode.

Attachments (1)

dialog.html (886 bytes) - added by bill 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by bill

Attachment: dialog.html added

comment:1 Changed 7 years ago by bill

Milestone: tbd1.7.3
Owner: set to bill
Status: newassigned

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28212]:

Account for exception on closing a Dialog when the DialogLevelManager tries to refocus the button that launched the Dialog, but gets an error. Happens on page unload on IE when the dijit.form.Button that launched the Dialog is destroyed before the Dialog. Fixes #15058 on trunk/ !strict.

comment:3 Changed 7 years ago by bill

In [28213]:

Account for exception on closing a Dialog when the DialogLevelManager? tries to refocus the button that launched the Dialog, but gets an error. Happens on page unload on IE when the dijit.form.Button that launched the Dialog is destroyed before the Dialog. Fixes #15058 on 1.7/ branch !strict.

comment:4 Changed 7 years ago by bill

#15603 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.