JQuery mouse.click () is launched from the keyboard

I found the strange behavior of the jQuery event click. If we use keyboard navigation (accessibility case), the click is triggered using Enter or Space (it depends on which HTML element we use).

There is a test page in jsfiddle. You can try to navigate the keyboard in the “Result” frame, and the click is triggered in different situations:

http://jsfiddle.net/DCXhN/9/

In the jQuery manual, I found the following click event description :

"A click event is dispatched to an element when the mouse pointer is over the element and the mouse button is pressed and released. Any HTML element can receive this event."

This is normal? How to intercept only mouse click events if this is normal behavior?

+5
source share
1 answer

Yes, it is normal. The jQuery documentation is correct, but a bit incomplete. More information on the WC3 website - for example:

. , , mousedown mouseup, . click (, ), .

, -, , click() , , .

, mousedown/up - , (, keydown/press/etc events to ).

+8

All Articles