Closed
Bug 199117
Opened 21 years ago
Closed 21 years ago
oncontextmenu doesn't work with addEventListener
Categories
(Core :: DOM: Events, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: agustinmfernandez, Assigned: saari)
Details
Attachments
(1 file, 1 obsolete file)
1.40 KB,
text/html
|
Details |
oncontextmenu doesn't work with addEventListener, even if it does work with the property of the element. Attaching testcase. I'm using Mozilla 1.3 so I will submit this as unconfirmed so that somebody checks if it was fixed since 1.3's release (not likely).
Reporter | ||
Comment 1•21 years ago
|
||
Dup of bug 180475?
Reporter | ||
Comment 3•21 years ago
|
||
It's not a dupe, in bug 180475 comment 2 Alex Vincent sais it was not valid because the two ways of doing it were considered identical (and that is wrong). I, however, don't say that, and use preventDefault() as he says. The problem is not just that the menu is not being cancelled, but rather that the handler is not called. Here is what Alex Vincent said: INVALID. DOM Level 2 Events operates on a different model than this. With addEventListener, when the event fires and the event listener is called, the function receives the event as its first argument. Returning false does not cancel the event. You do that by calling the preventDefault() method of the event. stopPropagation() works also, in some circumstances.
Reporter | ||
Comment 4•21 years ago
|
||
Well, I downloaded a recent build and the problem is still present: CONFIRMED with Windows XP, build 2003040808.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•21 years ago
|
||
Sorry, but this testcase is INVALID. You used 'oncontextmenu' rather than 'contextmenu'. Note that when using addEventListener, the event name itself should be given, without the prefixing 'on'. Once you correct that, the testcase works as expected.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Comment 6•21 years ago
|
||
Attachment #118406 -
Attachment is obsolete: true
Reporter | ||
Comment 7•21 years ago
|
||
Sorry for the confusion. VERIFIED INVALID.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•