bokuweb / react-rnd

🖱 A resizable and draggable component for React.
https://bokuweb.github.io/react-rnd/stories
MIT License
3.9k stars 325 forks source link

Draggable sticks to cursor when using control + click on MacOS #913

Open rwshaw opened 1 year ago

rwshaw commented 1 year ago

Overview of the problem

Using MacOS on any browser or react-rnd version. Control+clicking on a react-rnd component - usually used to open a context menu. Causes the component to be stuck to the cursor when the context menu is closed.

I'm using react-rnd version [10.4.1]

My browser is: Chrome [117.0.5938.62]

Reproduced project

Present on the sandbox on the repo: https://codesandbox.io/s/y3997qply9

Description

When using the control+left click on a draggable (which will open the context menu) the draggable item is then stuck to the cursor after the context menu is closed.

Steps to Reproduce

  1. Control + click on a react-rnd component using MacOS
  2. Left click to close the context menu
  3. Observe the component stuck to the cursor

Expected behavior

Control + left clicks to not activate the drag of the component

Actual behavior

The component is stuck to the cursor.

rnd