Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14983 closed bug (invalid)

trigger('click') on checkbox erases custom event properties

Reported by: kaeff Owned by: kaeff
Priority: low Milestone: None
Component: event Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:

Description

I want to simulate a shift-click on a check box using a keyboard binding using trigger and a custom event:

var triggerShiftClick = function() {

var e = jQuery.Event("click"); e.shiftKey = true; $("#checkbox").trigger(e);

};

However, the shiftKey property gets erased from the event the click handler receives.

Using this fiddle (http://jsfiddle.net/kPM7K/2/), I was able to reproduce it it 1.9.2, but not in 1.8.3.

I assume that it is related to jquery.event.special.click.trigger, which ignores the custom event object and forces a click().

Change History (3)

comment:1 Changed 6 years ago by kaeff

Sorry, forgot to set the version property correctly and can't modify it anymore.

comment:2 Changed 6 years ago by dmethvin

Component: unfiledevent
Owner: set to kaeff
Priority: undecidedlow
Status: newpending

We don't support older versions anyway. Can you verify that this is the correct behavior you expected? http://jsfiddle.net/kPM7K/3/

comment:3 Changed 6 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.