Skip to content

Instantly share code, notes, and snippets.

let mode: "idle" | "dragging" = "idle"
const dragHandler: InteractionHandler = {
onDragStart(gesture, app) {
if (intersection(gesture.elementsUnderCursor, app.selectedElements).size) {
mode = "dragging";
}
},
onPointerMove(gesture) {
// ignore pointer-moves when we haven't started dragging