Opened 19 months ago

Closed 17 months ago

Last modified 17 months ago

#14461 closed bug (fixed)

draggable cancels operation when shiftKey is pressed

Reported by: mar10w Owned by: mar10w
Priority: minor Milestone: 1.12.0
Component: ui.draggable Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:


I would like to implement a dragging modifiers (e.g. drag/drop creates a copy when Shift or Control key is pressed). Pressing shift or control should be allowed while dragging is active, i.e. while mousbutton is down.

This is possible with jQueryUI 1.10:

But in the current release, pressing a modifier key while dragging cancels the drag operation:

Change History (5)

comment:1 follow-up: Changed 19 months ago by scottgonzalez

  • Owner set to mar10w
  • Status changed from new to pending

I'm not seeing this behavior, can you please provide the OS and browser in which you're experiencing the problem? Does this work in any browsers for you?

comment:2 in reply to: ↑ 1 Changed 19 months ago by mar10w

  • Status changed from pending to new

I can reproduce it on OS X 10.10 on a MacBook Pro with Safari 8.0.8 when dragging the box in this jQuery UI 1.11. examples:

As soon as I press [fn], [shift, [ctrl], or [cmd], the drag operation stops (so maybe related to a keydown event?).

This does not happen when I press alphanum keys.

This does not happen in the 1.10 examples.

This does not happen with other browsers on Windows 10 (tried IE, Firefox, Chrome and Edge).

Last edited 19 months ago by mar10w (previous) (diff)

comment:3 Changed 17 months ago by hmethvin

  • Status changed from new to open

comment:4 Changed 17 months ago by Scott González

  • Resolution set to fixed
  • Status changed from open to closed

Mouse: Ignore mousemove events triggered by key presses in Safari

If the user presses control, meta, shift, or alt during a drag operation, Safari will trigger an event where event.which is 0. We use that scenario to detect that a mouseup occurred in a different document, so we need to ignore these events when one of the keys are pressed.

Fixes #14461 Closes gh-1620

Changeset: 17b5386e8cb48c522ddb581a001fef5434e57f9a

comment:5 Changed 17 months ago by scottgonzalez

  • Milestone changed from none to 1.12.0
Note: See TracTickets for help on using tickets.