Skip to main content

Bug Tracker

Side navigation

#14983 closed bug (invalid)

Opened April 10, 2014 01:04PM UTC

Closed April 25, 2014 08:31AM UTC

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().

Attachments (0)
Change History (3)

Changed April 10, 2014 01:06PM UTC by kaeff comment:1

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

Changed April 10, 2014 02:54PM UTC by dmethvin comment:2

component: unfiledevent
owner: → 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/

Changed April 25, 2014 08:31AM UTC by trac-o-bot comment:3

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!