Moved to domTarget for useGesture to fix pinch zoom error on Mac

This commit is contained in:
Mitchell McCaffrey
2021-02-07 20:44:30 +11:00
parent 5f5384a3e5
commit 291fd1512c
4 changed files with 25 additions and 13 deletions

View File

@@ -56,7 +56,7 @@ function MapEditor({ map, onSettingsChange }) {
true
);
const bind = useStageInteraction(
useStageInteraction(
mapStageRef.current,
stageScale,
setStageScale,
@@ -117,7 +117,6 @@ function MapEditor({ map, onSettingsChange }) {
}}
bg="muted"
ref={containerRef}
{...bind()}
>
<ReactResizeDetector handleWidth handleHeight onResize={handleResize}>
<Stage

View File

@@ -81,7 +81,7 @@ function MapInteraction({
const [interactionEmitter] = useState(new EventEmitter());
const bind = useStageInteraction(
useStageInteraction(
mapStageRef.current,
stageScale,
setStageScale,
@@ -199,7 +199,6 @@ function MapInteraction({
outline: "none",
}}
ref={containerRef}
{...bind()}
className="map"
>
<ReactResizeDetector handleWidth handleHeight onResize={handleResize}>