Opened 12 years ago

Closed 12 years ago

#3474 closed defect (fixed)

opening a drop-down button does not close others

Reported by: alex Owned by: bill
Priority: high Milestone: 0.9beta
Component: Dijit Version: 0.9
Keywords: Cc: alex
Blocked By: Blocking:

Description

in themeTester.html, if you open one of the drop down buttons, go to the "Buttons" tab and then open the first drop down marked "Save", it is then possible to click on the first drop down for "Edit" which, instead of closing the previous drop-down, shows the new drop-down along side the old one.

It seems the beahvior is not shared between two drop down buttons of the same type, although the behavior in which clicking to open another merely closes the first (but does not open the second) is also broken. This can be explored through the two right-most "Save" drop-down buttons.

Change History (3)

comment:1 Changed 12 years ago by bill

Interesting... when the first popup is opened, dijit.util.popup sets up a listener to mousedown events anywhere on the page (which will close the popup).

But when you press the second button, FormElement::_onMouse() handles the mousedown event (and sets CSS classes accordingly), but also stops the event, which prevents dijit.util.popup from hearing it and closing the first popup.

Should probably just remove the stopEvent() call from FormElement::_onMouse().

comment:2 Changed 12 years ago by bill

(In [9255]) Fix problem where opening one drop down does not close the previous.

When clicking the second button (to open the second dropdown), FormElement::_onMouse() was squelching the mousedown event, which prevented dijit.util.popup from hearing it and closing the first popup.

Refs #3474.

There's still a problem (on IE, at least) if you alternate back and forth between the Edit button and Save button. dijit.util.focus is trying to call menu.close() which doesn't exist. Need to rearchitect that code.

comment:3 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [9256]) Refactor dijit.util.focus. Fixes #3474.

Note: See TracTickets for help on using tickets.