Skip to content

Commit

Permalink
fix: prevent click when drag & click control #713
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Aug 5, 2022
1 parent 1d951c6 commit 2071c0d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@scena/matrix": "^1.1.1",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",
"gesto": "^1.11.2",
"gesto": "^1.12.0",
"overlap-area": "^1.1.0",
"react-compat-css-styled": "^1.0.8",
"react-css-styled": "^1.0.3"
Expand All @@ -114,7 +114,7 @@
"@scena/matrix": "^1.1.1",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",
"gesto": "^1.11.2",
"gesto": "^1.12.0",
"overlap-area": "^1.1.0",
"react-compat-css-styled": "^1.0.8",
"react-css-styled": "^1.0.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-compat-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@scena/matrix": "^1.1.1",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",
"gesto": "^1.11.2",
"gesto": "^1.12.0",
"overlap-area": "^1.1.0",
"react-compat-css-styled": "^1.0.8",
"react-css-styled": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@scena/react-guides": "^0.17.1",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",
"gesto": "^1.11.2",
"gesto": "^1.12.0",
"overlap-area": "^1.1.0",
"react-css-styled": "^1.0.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ export function getAbleGesto(
pinchOutside,
preventClickEventOnDrag: isTargetAbles ? preventClickEventOnDrag : false,
preventClickEventOnDragStart: isTargetAbles ? preventClickDefault : false,
preventClickEventByCondition: isTargetAbles ? null : (e: MouseEvent) => {
return moveable.controlBox.getElement().contains(e.target as Element);
},
checkInput: isTargetAbles ? checkInput : false,
};
const gesto = new Gesto(target!, options);

const isControl = eventAffix === "Control";

["drag", "pinch"].forEach(eventOperation => {
Expand Down

0 comments on commit 2071c0d

Please sign in to comment.