Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14704 closed feature (wontfix)

Make .trigger() accept varargs to event data

Reported by: rodolfo@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

Whenever I need to pass aditional parameters to .trigger(), I always feel that I could pass those as separate arguments after the event name, and not always as an array.

I'm not sure about backwards-compatibility issues though.

Change History (2)

comment:1 Changed 5 years ago by timmywil

Resolution: wontfix
Status: newclosed

You're right. It is a back-compat issue.

Consider this case...

$elem.trigger('click', [ {}, {} ], [ {}, {} ]);

or worse...

function awesome() {
  $elem.trigger('click', arguments, [ {}, {} ]);
}

To keep it simple, we've come to recommend that extra arguments always be passed in an array.

comment:2 Changed 5 years ago by rodolfo@…

I agree, haven't thought about that.

It's not really a big issue actually, just 2 extra chars.

But thanks for the attention!

Note: See TracTickets for help on using tickets.