jquery / jquery-simulate

jQuery Event Unit Testing Helpers
Other
173 stars 114 forks source link

If statement at the top of dispatchEvent causes event params to not work #25

Closed EvHaus closed 10 years ago

EvHaus commented 10 years ago

These lines:

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

At the top of dispatchEvent cause issues when trying to simulate Ctrl + Clicks. If you remove that if statement, everything works correctly. Here is the code that doesn't work correctly:

$(document.body).simulate('click', {ctrlKey: true});

Furthermore, looking at https://github.com/jquery/jquery-ui/blob/master/tests/jquery.simulate.js I see that those lines are not present. How come they were added in this repository?

scottgonzalez commented 10 years ago

Duplicate of #22.