react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

fix: disabling start for middle mouse button

Open cgood92 opened this issue 3 years ago • 1 comments

Fix: disabling start for middle mouse button

There are 5 possible values for event.button:

0: Main button pressed, usually the left button or the un-initialized state 1: Auxiliary button pressed, usually the wheel button or the middle button (if present) 2: Secondary button pressed, usually the right button 3: Fourth button, typically the Browser Back button 4: Fifth button, typically the Browser Forward button

(Source: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button)

We should not start dragging if either middle or right mouse buttons are clicked

I did not see any unit tests, please let me know if I missed that, as I would be happy to add a unit test.

cgood92 avatar Aug 22 '22 19:08 cgood92

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5b31ad44c696592cd0b0a05516e54051596fb116:

Sandbox Source
react-sortable-hoc-starter Configuration

codesandbox-ci[bot] avatar Aug 22 '22 19:08 codesandbox-ci[bot]