Open Bug 564691 Opened 15 years ago Updated 3 years ago

dblclick event fired on multiple right mouse button clicks

Categories

(Core :: DOM: Events, defect)

defect

Tracking

()

People

(Reporter: pdp, Unassigned)

References

(Blocks 1 open bug)

Details

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7 Build Identifier: 1.9.2 If you rightclick multiple times on an element that has dblclick event listener, the event will trigger. Left mouse click followed by right mouse click will also trigger the event. It seems that this is especially problematic with Mac OS if you use an external mouse. Consider the following scenario: 1. Select an item from a tree view. 2. Right click to get context menu. Since these two operations happen quite quickly, the result is a trigger of any dblclick event handlers which is the incorrect behaviour. Reproducible: Always Steps to Reproduce: 1. Create a treeview with dblclick event handler with one item and context menu. 2. Select the item (leftclick) and rightclick to get the context menu. Works the best on macosx. On Linux and Windows just rightclick multiple times (more than twice) or alternate several lift and right mouse clicks. Actual Results: dblclick event fires Expected Results: dblclick event should not fire especially when the user interaction is leftclick followed by rightclick
that's a feature of windows. is this also a feature of mac OSX and linux too? I think yes. depending on your delay between clicks (repeat speed), you will get either double click or single click. 3+ rapid-in-a-row should get you a double-click. 1 in a row or one with enough time between (probably adjustable in the control panel/prefs) should give you a single click. try ot on some other program and see what happens.
indeed, isn't this working as designed?
I think the question is whether there should be DOM dblclick events fired for non-primary mouse clicks. For example, we don't fire a DOM click event for a non-primary mouse click... Olli, do you know whether this was discussed at all?
Flags: needinfo?(bugs)
We do fire click on window or document level for non-primary clicks (some ancient). But we should remove that. Others (well, at least blink) are trying to remove click for non-primary too and there is a proposal to dispatch auxclick instead for non-primary.
Flags: needinfo?(bugs)
Right; I know all that. The question is what about dblclick.
Flags: needinfo?(bugs)
ah, that. Ok, per current auxclick draft "UIEvent.detail: indicates the current click count; the attribute value MUST be 1 when the user begins this action and increments by 1 for each click." I think that covers this case.
In that we could stop firing dblclick for non-primary clicks and people who care could use auxclick, right?
yes.
Flags: needinfo?(bugs)
Blocks: 309892
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.