Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12595 closed defect (fixed)

[regression] dijit.base_.popup: cannot popup a domNode that has no parentNode

Reported by: baraclese Owned by: bill
Priority: high Milestone: 1.6.1
Component: Dijit Version: 1.6.0
Keywords: dijit popup Cc:
Blocked By: Blocking:

Description

This applies to v1.6.0 and I saw that the same error was backported to v1.5.1.

In dijit/_base/popup.js:80 in function _createWrapper:

change the line from var wrapper = widget.declaredClass ? widget._popupWrapper : (dojo.hasClass(widget.parentNode, "dijitPopup") && widget.parentNode),

to var wrapper = widget.declaredClass ? widget._popupWrapper : (widget.parentNode && dojo.hasClass(widget.parentNode, "dijitPopup")),

If dojo.hasClass(widget.parentNode, '...') is executed with a nonexisting parentNode then that call will produce a javascript error, therefore the assertion that widget.parentNode exists must come before the dojo.hasClass call.

Change History (3)

comment:1 Changed 8 years ago by bill

Milestone: tbd1.6.1
Owner: set to bill
Summary: dijit.base_.popup regression: cannot popup a domNode that has no parentNode[regression] dijit.base_.popup: cannot popup a domNode that has no parentNode

OK, thanks, I see it, looks like you are using the old APi to popup.open() passing in a DOMNode rather than a widget, and that we are missing tests for that.

comment:2 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

(In [24205]) Fix exception when passing in DOMNode rather than widget. Fixing on 1.6 branch, fixes #12595 !strict.

comment:3 Changed 8 years ago by bill

Fixed in [24204] on trunk, trac missed the commit.

Note: See TracTickets for help on using tickets.