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

eventProps not working with JQuery 1.10.2

Open cschloesser opened this issue 10 years ago • 3 comments

jquery-ui.js:919: event.preventDefault(); JqueryUI 1.9/1.10

Unfortunately I get a "Uncaught TypeError: Illegal invocation" and I'm not able to downgrade...

Does anyone have a workaround already?

Edit: I extended the demo.html to use eventProps - does also not work!

cschloesser avatar Sep 03 '14 14:09 cschloesser

Does this happen only in InternetExplorer? Because I can't reproduce it in Opera, Firefox or Chrome.

I'm not able to downgrade...

And what about upgrading? It doesn't happen with jQuery 2.1.0 so maybe it's fixed in some 1.11.x version!?

j-ulrich avatar Sep 03 '14 18:09 j-ulrich

No, I tested that in Chrome (also not working in IE)

I did some more investigation on that and I found out that this works in the demo:

$('#customCombo').simulate("key-sequence", {
sequence: "|{leftarrow}This is a test!{del}", 
delay: 100,
eventProps: {
jQueryTrigger: true,
simulated: true
}});

But not this:

$("#img0").draggable({
    stop: function(event){
        console.log(event);
    }
});
$("#img0").simulate("drag-n-drop", {
    dx: 71,
    dy: 71,
    eventProps: {
        jQueryTrigger: true,
        simulated: true
    }
});
[...]
<div style="background-color:red;position:absolute;" id="img0">Test</div>

So it seems to only fail on drag and drop! Any ideas?

cschloesser avatar Sep 04 '14 10:09 cschloesser

This error goes down to preventDefault invocation in jQuery UI Mouse utility: https://github.com/jquery/jquery-ui/blob/master/ui/mouse.js#L125

andreyvolokitin avatar Dec 03 '14 22:12 andreyvolokitin