j-ulrich / jquery-simulate-ext

jQuery simulate extended
https://j-ulrich.github.io/jquery-simulate-ext/
Other
146 stars 48 forks source link

MouseEvent overload: Allow options to be an optional paramter #37

Closed weikinhuang closed 7 years ago

weikinhuang commented 7 years ago

When using this plugin without specifying options for original mouse events, ex: $el.simulate('click');. It currently throws an error:

Uncaught TypeError: Cannot read property 'pageX' of undefined
    at $.simulate.mouseEvent (http://localhost:9876/base/node_modules/jquery-simulate-ext/src/jquery.simulate.ext.js:21:14)
    at $.simulate.createEvent (http://localhost:9876/base/node_modules/jquery-simulate/jquery.simulate.js:83:16)
    at $.simulate.simulateEvent (http://localhost:9876/base/node_modules/jquery-simulate/jquery.simulate.js:73:20)
    at new $.simulate (http://localhost:9876/base/node_modules/jquery-simulate/jquery.simulate.js:32:8)
    at HTMLButtonElement.<anonymous> (http://localhost:9876/base/node_modules/jquery-simulate-ext/src/jquery.simulate.drag-n-drop.js:27:5)
    at Function.each (http://localhost:9876/base/node_modules/jquery/dist/jquery.js:374:23)
    at jQuery.fn.init.each (http://localhost:9876/base/node_modules/jquery/dist/jquery.js:139:17)
    at jQuery.fn.init.$.fn.simulate (http://localhost:9876/base/node_modules/jquery-simulate-ext/src/jquery.simulate.drag-n-drop.js:26:16)
    at Object.<anonymous> (http://localhost:9876/base/test/jasmine/index.js:141113:42)
j-ulrich commented 7 years ago

Thanks!

However, note that this plugin is not maintained anymore.