Ticket #7534 (closed bug: wontfix)
event.originalTarget no longer is passed to an event handler listening element on firefox 3.5+
| Reported by: | jquery@… | Owned by: | |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.5 |
| Component: | event | Version: | 1.5 |
| Keywords: | regression | Cc: | |
| Blocking: | Blocked by: |
Description
When listening to events, the originalTarget property is no longer passed.
Expected; 1) Using jQuery attach an onchange event to an input element and log e.originalTarget(example below) 2) Enter content into input element to fire the change event 3) The originalTarget is reported as the originalTarget
Actual; 1) Using jQuery attach an onchange event to an input element and log e.originalTarget(example below) 2) Enter content into input element to fire the change event 3) The originalTarget is reported as undefined
$('input').change(function(e) {
console.log('element', e.originalTarget);
});
This worked in jQuery 1.4.2. It also affects other event handlers attached to any.
- The version(s) of jQuery affected; 1.4.4
- The browser (or browsers) that you are able to reproduce the bug in, including version numbers. FF 3.6.12 + 4.0b7
- The operating system (or operating systems) you experienced the bug on. Mac OS 10.6, Snow Leopard
Change History
comment:2 Changed 3 years ago by rwaldron
- Keywords regression, needsreview added
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to event
Confirmed;
comment:4 Changed 3 years ago by dmethvin
- Status changed from open to closed
- Resolution set to wontfix
It was this commit for #2814:
https://github.com/jquery/jquery/commit/69994211b078b8711220eaef33cc1bd6a63c5772
That jQuery.event.fix method is a bottleneck for event delivery so we should keep it as short as possible and not include browser-specific properties.
You can still get to this Mozilla-specific property via event.originalEvent.originalTarget.
comment:5 Changed 3 years ago by dmethvin
- Keywords regression added; regression, needsreview removed
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

JSfiddle test case; http://jsfiddle.net/X8a9b/1/