jquery-simulate icon indicating copy to clipboard operation
jquery-simulate copied to clipboard

The event object is not passed to the handler

Open ruslansagitov opened this issue 11 years ago • 1 comments

Regression after https://github.com/jquery/jquery-simulate/commit/206bbf873e8f63646fcd1daa3c4713c2ebd66196. In this commit, the following code was added:

if ( elem[ type ] ) {
    elem[ type ]();
} else …

But in this code, the event object is not passed to the handler! It leads to lots of bugs, for example, inability to use options for the click event:

$('button').simulate('click', { button: 2 }); /* right mouse button */

It has bad influence on the focus (and hence focusin and focusout) event as well.

ruslansagitov avatar Jun 14 '14 07:06 ruslansagitov

:+1:

AidasK avatar Jan 03 '15 10:01 AidasK