Side navigation
#8055 closed bug (invalid)
Opened January 25, 2011 08:46PM UTC
Closed January 25, 2011 10:48PM UTC
event.originalEvent is undefined when an event triggered manually
Reported by: | NV | Owned by: | NV |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Attachments (0)
Change History (3)
Changed January 25, 2011 08:57PM UTC by comment:1
owner: | → NV |
---|---|
status: | new → pending |
Changed January 25, 2011 09:23PM UTC by comment:2
status: | pending → new |
---|
The proper link is http://elv1s.ru/files/js/jQuery/originalEvent.html
Changed January 25, 2011 10:48PM UTC by comment:3
_comment0: | [http://jsfiddle.net/jitter/nTCXz/ Test case] ported to jsFiddle. \ \ This isn't a bug. \ \ The [http://api.jquery.com/category/events/event-object/ Event-object documentation] says: \ > Certain '''native events''' may have special properties that can be accessed as properties of the event.originalEvent object. \ \ The [http://api.jquery.com/trigger/ trigger() documentation] (`.focus()` is short for `.trigger("focus")`) says: \ > Although .trigger() simulates an event activation, complete with a synthesized event object, it does '''not perfectly replicate''' a naturally-occurring event. \ \ So as triggering focus with `.focus()` isn't a native event the `originalEvent` property can't available and isn't. \ \ My test case also clearly shows that when the focus event is triggered natively you can access the `originalEvent` property as documented. → 1295995807781206 |
---|---|
component: | unfiled → event |
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
Test case ported to jsFiddle.
This isn't a bug.
The Event-object documentation says:
Certain native events may have special properties that can be accessed as properties of the event.originalEvent object.
The trigger() documentation (.focus()
is short for .trigger("focus")
) says:
Although .trigger() simulates an event activation, complete with a synthesized event object, it does not perfectly replicate a naturally-occurring event.
As triggering focus with .focus()
isn't a native event, the originalEvent
property can't available.
My test case also clearly shows that when the focus event is triggered natively you can access the originalEvent
property as documented.
Thanks for submitting a ticket to the jQuery bug tracker. We've checked the link you provided and this is currently not loading (from the looks of it, you may have accidentally posted a local link). If you could kindly repost your reduction on jsFiddle.net we'll be more than happy to evaluate the bug you're experiencing.