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).
Dup of bug 180475?
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.
Well, I downloaded a recent build and the problem is still present: CONFIRMED with Windows XP, build 2003040808.
Status: UNCONFIRMED → NEW
Ever confirmed: true
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
Last Resolved: 15 years ago
Resolution: --- → INVALID
Created attachment 121329 [details] Corrected testcase
Attachment #118406 - Attachment is obsolete: true
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.