diff --git a/src/components/ObjectView.tsx b/src/components/ObjectView.tsx index 97d79d6..cd6cf07 100644 --- a/src/components/ObjectView.tsx +++ b/src/components/ObjectView.tsx @@ -3,6 +3,7 @@ import type { ObjectInstance } from "../types"; import { useEffect, useRef, type RefObject } from "react"; import type { Group, Mesh } from "three"; import { Edges, TransformControls } from "@react-three/drei"; +import type { ThreeEvent } from "@react-three/fiber"; import { state } from "../state"; import { nextSelectionEditMode } from "../state/worldEditor"; import type { R3 } from "../types/3d"; @@ -38,9 +39,11 @@ export const ObjectView = observer(function ({ object }: ObjectViewProps) { }; }, [isSelected]); - const handleClick = (e: { stopPropagation: () => void }) => { + const handleClick = (e: ThreeEvent) => { if (!state.worldEditor.isEnabled) return; + if (e.delta > 5) + return; e.stopPropagation(); state.worldEditor.setSelectedObject(object.id, nextSelectionEditMode(selectionMode));