Skip to main content

Search and Top Navigation

#7858 closed bug (fixed)

Opened November 10, 2011 12:56AM UTC

Closed November 22, 2011 01:31PM UTC

Last modified November 22, 2011 01:32PM UTC

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.

Attachments (0)
Change History (4)

Changed November 18, 2011 11:20PM UTC by celtric comment:1

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;
});

Changed November 22, 2011 01:31PM UTC by Scott González comment:2

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

Changed November 22, 2011 01:31PM UTC by Scott González comment:3

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

Changed November 22, 2011 01:32PM UTC by scottgonzalez comment:4

milestone: 1.91.8.17