Bug Tracker

Modify

Ticket #2140 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

jQuery.event.trigger bug in Opera when using extra parameter

Reported by: scott.gonzalez Owned by:
Priority: major Milestone: 1.2.2
Component: event Version: 1.2.1
Keywords: event trigger opera Cc:
Blocking: Blocked by:

Description

When the extra parameter is used in jQuery.event.trigger and there is no default event for the type and the element does not have "handle" data, the event fails in Opera.

The problem occurs because val is undefined when this line is executed: var ret = extra.apply( elem, data.concat( val ) );

This change fixes the problem:

var ret = extra.apply( elem, data.concat( val
false ) );

I'm not too familiar with the internal event code, so I'm not sure if that is an appropriate default value. I tried using null, but that causes the error as well.

I came across this problem using the Droppable plugin with a callback (drop, over and out all cause the problem).

Change History

comment:1 Changed 5 years ago by scott.gonzal

Oops, the WikiFormatting mangled the code, that should have been:

var ret = extra.apply( elem, data.concat( val || false ) );

Perhaps a cleaner solution is:

var ret = extra.apply( elem, val !== undefined ? data.concat( val ) : data );

comment:2 Changed 5 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in SVN rev [4440].

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.