Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7858 closed bug (fixed)

ctrl-click to select multiple elements not working

Reported by: ToastBusters Owned by:
Priority: minor Milestone: 1.8.17
Component: ui.selectable Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Description

When paired with jQuery 1.7 the selectable plugin does not allow selecting multiple element by ctrl+clicking, but downgrading jQuery to 1.6 does work. I'm not sure if this is a bug in jQuery UI or in jQuery itself.

The bug is easy to reproduce, simply load up the demo for the selectable plugin using 1.7 instead of 1.6 and ctrl+click will behave like a normal click. I encountered this on both Chrome and Firefox on linux if it makes a difference.

Change History (4)

comment:1 Changed 11 years ago by celtric

Related discussion: http://bugs.jquery.com/ticket/10666

Basically jQuery 1.7 changed the way it assigns event.metaKey, and this broke UI's selectable.

I provide a small fix to overcome this problem (until they fix it in a new version of UI):

$('#selectable').selectable().on('mousedown', '*', function(e){
  if (e.ctrlKey)
    e.metaKey = e.ctrlKey;
});

comment:2 Changed 11 years ago by Scott González

Resolution: fixed
Status: newclosed

Selectable: Explicitly check event.ctrlKey now that jQuery differentiates between meta and ctrl. Fixes #7858 - ctrl-click to select multiple elements not working.

Changeset: 35dd0417bdb442ad00a9eb37a85db5ddf1b14615

comment:3 Changed 11 years ago by Scott González

Selectable: Explicitly check event.ctrlKey now that jQuery differentiates between meta and ctrl. Fixes #7858 - ctrl-click to select multiple elements not working. (cherry picked from commit 35dd0417bdb442ad00a9eb37a85db5ddf1b14615)

Changeset: ffd3f510f1c0fbfe99ce2f1aab81d56d9b03f88e

comment:4 Changed 11 years ago by Scott González

Milestone: 1.91.8.17
Note: See TracTickets for help on using tickets.