Skip to content

Commit

Permalink
Changed check include other modifier keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Barklund committed Jun 17, 2022
1 parent 18f5a73 commit 6ac59c6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ function useReordering(onPositionChange, numChildren) {
({ position: currentPos, onStartReordering = () => {} }) =>
(evt) => {
// Only allow reordering with non-modified left-click.
// Modified (shift+ or meta+) clicks are for selection.
// Modified (shift, meta, alt, ctrl) clicks are for selection.
const isModified =
evt.shiftKey || evt.metaKey || evt.ctrlKey || evt.altKey;
// Right-clicks (button===2) are for context menu.
if (!evt.shiftKey && !evt.metaKey && evt.button === 0) {
const isLeftButton = evt.button === 0;
if (!isModified && isLeftButton) {
onStartReordering();
setCurrentPosition(currentPos);
setDragTarget(evt.target);
Expand Down

0 comments on commit 6ac59c6

Please sign in to comment.