Skip to main content

Search and Top Navigation

#5967 closed bug (patcheswelcome)

Opened August 18, 2010 05:12AM UTC

Closed October 28, 2015 08:56PM UTC

Mac Safari Draggable after Ctrl Click

Reported by: newbee Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.mouse Version: 1.8.4
Keywords: Cc:
Blocked by: Blocking:
Description

Ctrl+Click on Mac acts as right click, but is reported as left click in Safari.

My remedy is in $.ui.mouse._mouseDown, change:

btnIsLeft = (event.which == 1)

to:

btnIsLeft = ((navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase() == "mac") ? (!event.ctrlKey && event.which == 1) : (event.which == 1).
Attachments (0)
Change History (8)

Changed August 18, 2010 05:13AM UTC by newbee comment:1

Sorry that the limit of attachment is so small, my recording is only 1M...

Changed August 18, 2010 12:26PM UTC by scottgonzalez comment:2

component: ui.coreui.mouse
description: Our project uses jQuery draggable and droppable to implement file moving. \ I've got a bug on Mac Safari with this dnd operation. \ I shall attache the recording my QA gave me, you can download the player at our website http://www.webex.com/downloadplayer.html. \ My remedy is in "$.ui.mouse._mouseDown", \ change this line of code btnIsLeft = (event.which == 1) to below: \ btnIsLeft = ((navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase() == "mac") ? (!event.ctrlKey && event.which == 1) : (event.which == 1). \ \ It is because ctrl-click is treated as right click on mac, but according to the dnd code, right click (event.which === 3) won't trigger mouse start event. \ \ I found that Firefox on mac is OK with "event.which". I guess the best solution would be changing event.which in the very beginning that this event object is created by jQuery. \ \ Ctrl+Click on Mac acts as right click, but is reported as left click in Safari. \ \ My remedy is in $.ui.mouse._mouseDown, change: \ {{{ \ btnIsLeft = (event.which == 1) \ }}} \ to: \ {{{ \ btnIsLeft = ((navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase() == "mac") ? (!event.ctrlKey && event.which == 1) : (event.which == 1). \ }}}

Changed February 27, 2012 04:11PM UTC by jzaefferer comment:3

resolution: → worksforme
status: newclosed

Looks like this was addressed in Safari itself, can't reproduce.

Changed February 27, 2012 04:12PM UTC by jzaefferer comment:4

resolution: worksforme
status: closedreopened

Got that wrong. Ctrl+Click is not working properly. Right click (two-finger click) works fine...

Changed February 27, 2012 04:12PM UTC by jzaefferer comment:5

status: reopenedopen

Changed October 11, 2012 09:07PM UTC by scottgonzalez comment:6

milestone: TBD2.0.0

Changed October 13, 2015 07:37PM UTC by scottgonzalez comment:7

The only solution I can think of (that doesn't include UA parsing) is listening for contextmenu occurring immediately after mousedown. This requires making the start phase asynchronous though, which will probably complicate the code quite a bit.

Changed October 28, 2015 08:56PM UTC by scottgonzalez comment:8

resolution: → patcheswelcome
status: openclosed

After five years with only one report for this, I'm going to close as patches welcome. Safari causes way too many bugs for us to keep working around all these cases.