Opened 11 years ago

Closed 10 years ago

#12552 closed defect (fixed)

Unhandled exception when calling dijit.getFocus and the current focus is a node that has been removed from the DOM

Reported by: mgottli Owned by:
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:


This problem only seems to occur with widgets that can have selection like a TextBox? or a Textarea. If that widget has focus and then you remove the widget from the DOM (or destory it calling destroyRecursive) and then call dijit.getFocus(), an exception will be thrown. The error is in dijit/_base/focus.js and seems to have something to do with trying to get the selection. Attached is an example that causes the error.

Attachments (1)

test_getFocusBug.html (1.6 KB) - added by mgottli 11 years ago.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by mgottli

Attachment: test_getFocusBug.html added

comment:1 Changed 11 years ago by mgottli

Also, just want to add that this happens in FireFox? but not IE.

comment:2 Changed 11 years ago by bill

Component: GeneralDijit

comment:3 Changed 10 years ago by bill

Milestone: tbd1.7
Resolution: fixed
Status: newclosed

This is fixed, in a sense, by #12366. The new way to get focus is to access curNode in the dijit/focus module. That doesn't involve selection, so it doesn't have this problem.

Note: See TracTickets for help on using tickets.