Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16867 closed defect (fixed)

Menu: listener leak on mouseenter listener

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.7.5
Component: Dijit Version: 1.4.0
Keywords: Cc: Douglas Hays
Blocked By: Blocking:

Description

Every time a drop down menu is opened, _MenuBase runs this code:

popup.own(on(popup.domNode, "mouseenter", lang.hitch(self, "_onPopupHover"))); // cleaned up when the popped-up widget is destroyed on close

The big problem is that new listeners keep getting created, but the old ones are never destroyed. The comment is incorrect; the drop down is not destroyed when it's closed. The code should probably be using on.once(), and the listener should also be removed when the drop down is closed, even if it never got a mouseenter event. Error is from [20098], refs #6773.

The other problem is that "mouseenter" is not a valid event name, except on IE. It should be dojo/mouse::enter, or actually plain "mouseover" would work too. This is a mistake from [30834], refs #16784 .

Change History (5)

comment:1 Changed 7 years ago by bill

Resolution: fixed
Status: newclosed

In [30888]:

Fix leaked listeners (where new listeners were created but the old ones weren't removed), fixes #16867 on trunk !strict.

comment:2 Changed 7 years ago by bill

In [30889]:

Fix leaked listeners (where new listeners were created but the old ones weren't removed), fixes #16867 on 1.8/ branch !strict.

comment:3 Changed 7 years ago by bill

In [30890]:

Fix leaked listeners (where new listeners were created but the old ones weren't removed), fixes #16867 on 1.7/ branch !strict.

comment:4 Changed 7 years ago by bill

Cc: Douglas Hays added
Milestone: tbd1.7.5
Version: 1.8.31.4.0

comment:5 Changed 7 years ago by bill

In [30891]:

redo fix for leaked listeners (where new listeners were created but the old ones weren't removed), fixes #16867 on 1.7/ branch !strict.

Note: See TracTickets for help on using tickets.