Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#4077 closed defect (fixed)

ComboBox: dijit.form._ComboBoxMenu errors with HTML item contents

Reported by: guest Owned by: haysmark
Priority: high Milestone: 1.0
Component: Dijit - Form Version: 0.9
Keywords: dijit ComboBox Cc:
Blocked By: Blocking:

Description

dijit.form._ComboBoxMenu does not correctly keep track of current item during mouse-overs.

To reproduce (FF 2.0.0.6):

  1. Go to

http://archive.dojotoolkit.org/dojo-2007-08-09/dojotoolkit/dijit/tests/form/test_FilteringSelect.html

  1. Click down arrow on filtering select # 5
  2. Hover mouse over Alabama map
  3. Press down arrow a few times

You should see errors appear in Firebug. Also, notice that the item is no longer highlighted when mouse is positioned on map image rather than item text.

These errors are due to the fact that _ComboBoxMenu incorrectly thinks the exact target of mouseover events is a menu item. In fact, it could be a child element of a menu item.

To fix the error, change to body of _ComboBoxMenu.onmouseover() to this:

onmouseover:function(/*Event*/ evt){
	if(evt.target === this.domNode){ return; }
	
	var tgt=evt.target;
	// while the clicked node is inside the div
	while(!tgt.item){
		// recurse to the top
		tgt=tgt.parentNode;
	}
	
	this._focusOptionNode(tgt);
}

The above code adds logic to look for the menu item up the DOM tree if the target of the event is not a menu item. Similar logic is used in _ComboBoxMenu.onclick().

Attachments (1)

4077.patch (621 bytes) - added by haysmark 12 years ago.
Fix for 1.0 trunk

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by bill

Component: GeneralDijit
Milestone: 1.0
Owner: changed from anonymous to haysmark

Either for 0.9 or 1.0.

comment:2 Changed 12 years ago by bill

Summary: dijit.form._ComboBoxMenu errors with HTML item contentsComboBox: dijit.form._ComboBoxMenu errors with HTML item contents

comment:3 Changed 12 years ago by haysmark

Status: newassigned

Changed 12 years ago by haysmark

Attachment: 4077.patch added

Fix for 1.0 trunk

comment:4 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [10335]) Fixes #4077. Proxy commit for haysmark. When determining the next node to highlight, ComboBoxMenu? uses the same recursion as seen in onclick.

comment:5 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.