Skip to main content

Search and Top Navigation

#14461 closed bug (fixed)

Opened September 02, 2015 09:21PM UTC

Closed October 27, 2015 06:12PM UTC

Last modified October 27, 2015 06:12PM UTC

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:
Description

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:

http://api.jqueryui.com/1.10/draggable/#entry-examples

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

https://jqueryui.com/draggable/

Attachments (0)
Change History (5)

Changed September 08, 2015 04:00PM UTC by scottgonzalez comment:1

owner: → mar10w
status: newpending

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?

Changed September 08, 2015 06:27PM UTC by mar10w comment:2

_comment0: 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: \ https://jqueryui.com/draggable/ \ https://api.jqueryui.com/draggable/ \ 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). \ \ 1441737044338946
status: pendingnew

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:

https://jqueryui.com/draggable/

https://api.jqueryui.com/draggable/

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

Changed October 17, 2015 09:52PM UTC by hmethvin comment:3

status: newopen

Changed October 27, 2015 06:12PM UTC by Scott González comment:4

resolution: → fixed
status: openclosed

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

Changed October 27, 2015 06:12PM UTC by scottgonzalez comment:5

milestone: none1.12.0