Opened 13 years ago

Closed 13 years ago

#301 closed defect (invalid)

Menu2Manager onClick does not work on IE

Reported by: carl.shimer@… Owned by: anonymous
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

I think the issue is because dojo.event.connect is used instead of dojo.event.browser.addListener. The onClick handler depends on the value of the event so the current code will cause an exception on IE.

The attached patch simply uses addListener (code moved to the bottom to pick up the implementation of onClick).

Attachments (1)

Menu2.diff (629 bytes) - added by carl.shimer@… 13 years ago.
Diff of Menu2.js

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by carl.shimer@…

Attachment: Menu2.diff added

Diff of Menu2.js

comment:1 Changed 13 years ago by bill

It seems to work. Can you describe the testcase? Clicking a blank area of the screen should make the currently displayed menu disappear.

comment:2 Changed 13 years ago by carl.shimer@…

Hmm... I think the problem is that I use dojo.event.browser.addListener elsewhere in my application for mousedown events. Looking at this dojo source it appears that both dojo.event.connect and addListener fixup the event for IE. I have been using addListener for a while, mostly because I started out with FF code and use dojo to make my events IE compatible.

So, is the bug that dojo.event.connect and dojo.event.browser.addListener are not compatible when combined?

comment:3 Changed 13 years ago by bill

Hmm, maybe. I've never even heard of dojo.event.browser.addListener. I thought everyone used dojo.event.connect. Hopefully someone else can comment on this. (I'm using dojo.event.connect and my code works on both FF and IE)

comment:4 Changed 13 years ago by alex

So browser.addListener() is a wrapper that helps out in memory leak managment, but isn't something folks should be using manually. dojo.event.connect() is the preferred way of setting event handlers on DOM Nodes.

Regards

comment:5 Changed 13 years ago by bill

Resolution: invalid
Status: newclosed

OK, I think we should close this bug, since dojo.event.connect() works and users shouldn't be calling addListener().

Note: See TracTickets for help on using tickets.