Ticket #4164 (closed bug: invalid)
IE doesn't get an event.which property when fixing click events
| Reported by: | larholm | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.2 |
| Component: | event | Version: | 1.3.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When you leftclick in IE any assigned click handlers will never have a "which" property on their event objects, despite having been through jQuery.event.fix().
The code in question is the following:
Add which for click: 1 == left; 2 == middle; 3 == right Note: button is not normalized, so don't use it if ( !event.which && event.button )
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
Since leftclicking sets the button property to 0 the above will never be triggered in IE, and IE will not get a which property on click events.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

So it sounds like the fix is something like: