Bug Tracker

Modify

Ticket #8055 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

Change History

comment:1 Changed 2 years ago by addyosmani

  • Owner set to NV
  • Status changed from new to pending

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 2 years ago by NV

  • Status changed from pending to new

comment:3 Changed 2 years ago by jitter

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to event

 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 2 years ago by jitter (previous) (diff)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.