Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1499 closed defect (invalid)

dojo.widget.PopupContainer, small bug?

Reported by: johnjdevine@… Owned by: liucougar
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

Just downloaded nightly build 9-24-06, and in extending ComboBox?, ran into situation where the optionsNode wouldn't close on select. Tracked it down to line 83 of PopupContainer? missing a "this." prefix:

open: function(x, y, parent, explodeSrc, orient, padding){
   ...
   ...
if(typeof x == 'object'){
	node = x;
	aroundOrient = explodeSrc;
	explodeSrc = parent;
--      parent = y;        
++	this.parent = y;
	around = true;
}

Just a nightly build, so probably someone's already on it, but just thought I'd point it out. In the same nightly build ComboBox? calls open with:

this.popupWidget.open(this.cbTableNode, this, this.downArrowNode);

Change History (8)

comment:1 Changed 13 years ago by bill

Owner: changed from bill to liucougar

comment:2 Changed 13 years ago by dylan

Milestone: 0.4
Owner: changed from liucougar to dylan
Status: newassigned

comment:3 Changed 13 years ago by dylan

Given the use of parent as a local variable, I'm not sure that's the right fix. Perhaps it's more an issue of needing to make sure this.parent gets set to parent before that function finishes?

comment:4 Changed 13 years ago by guest

Well, I think the call from ComboBox? was correct: the second argument "this" is intended to be the parent and the third, "this.downArrowNode", the explode source, because the popup widget refers to parent.domNode. Without the change, this.parent kept it's reference to the third argument (downArrowNode), and failed when open was called and downArrowNode.domNode didn't exist.

I do think it's kind of a confusing way to resolve the arguments. Wish javascript had overloaded methods.

comment:5 Changed 13 years ago by dylan

Milestone: 0.40.4.1

comment:6 Changed 13 years ago by bill

Owner: changed from dylan to liucougar
Status: assignednew

comment:7 Changed 13 years ago by liucougar

Resolution: invalid
Status: newclosed

that call is correct

I assume its your code doing the wrong thing

if not, please submit a demo file

comment:8 Changed 12 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.