Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9571 closed bug (worksforme)

Pass 'empty string' as arbitrary data with , trigger()

Reported by: soderslatt@… Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

Sending data with trigger differs between version 1.5 and 1.6.1. I can't figure out what causes this behaviour from reading the official change log.

With 1.6.1 => undefined, undefined

With 1.5.0 => (an empty string), undefined

$(document).ready(function() {
$("p").click( function (event, a, b) {
console.log(a);
console.log(b);
} ).trigger("click", '');
});

Change History (3)

comment:1 Changed 8 years ago by soderslatt@…

sorry, it's my first report, jsfiddle below:

http://jsfiddle.net/HPvfg/

http://jsfiddle.net/HPvfg/1/

comment:2 Changed 8 years ago by timmywil

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

This works for me: http://jsfiddle.net/NE8ma/1/

comment:3 Changed 8 years ago by dmethvin

This was a bug I introduced in 1.6 and rwaldron fixed, should be in 1.6.2 when that is released. As a workaround, specify an Array with your string, like .trigger("click", ['']) (the code converts it internally to an array if you don't supply one).

Note: See TracTickets for help on using tickets.