Bug Tracker

Opened 7 years ago

Closed 7 years ago

#8055 closed bug (invalid)

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:

Change History (3)

comment:1 Changed 7 years ago by addyosmani

Owner: set to NV
Status: newpending

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.

comment:2 Changed 7 years ago by NV

Status: pendingnew

comment:3 Changed 7 years ago by jitter

Component: unfiledevent
Priority: undecidedlow
Resolution: invalid
Status: newclosed

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.

Last edited 7 years ago by jitter (previous) (diff)
Note: See TracTickets for help on using tickets.