Opened 13 years ago
Closed 12 years ago
#2722 closed defect (fixed)
dojo.event.browser.addListener creates closure
Reported by: | guest | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Events | Version: | 0.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
While it's nice that dojo.event.browser.addListener
attempts to fix the different event models for the various browsers, the creation of an anonymous function to perform this fix means that a later call to dojo.event.browser.removeListener
with the same parameters will fail.
The documentation doesn't mention that addListener
returns the anonymous function it creates. Nor does it mention the implications of the default value of the dontFix
parameter -- that you'll be unable to remove the handler.
Most likely, the dontFix
parameter should be changed to fixEvent
where callers must deliberately request the creation of a closure.
Attachments (1)
Change History (2)
Changed 13 years ago by
Attachment: | addListenerBug.html added |
---|
comment:1 Changed 12 years ago by
Milestone: | → 0.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
With the new architecture of 0.9 where disconnect() takes a handle (returned from connect) this is no longer an issue.
Test Case that demonstrates incorrect behaviour of dojo.event.addListener