jquery / jquery/jquery-simulate
The event object is not passed to the handler
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 172
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the event-dispatch code introduced in commit 206bbf873e8f63646fcd1daa3c4713c2ebd66196, especially the elemtype branch. Trace the click and focus paths and verify that the supplied event object reaches their handlers, including the button option for click. Done means handlers receive the event object without regressing focusin or focusout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100