this.mouseX = 0;
onPointerUp: hisstopDragging,
}
startDragging(ev) { // We want to handle a drag during a mouse button is pressed. So, we can // ignore pointer events which are caused by other devices.
f evpointerType! "mouse" { return;
}
// This allows for double-click. if (this.props.onDoubleClick && xDiff +yDiff< 1
}
} this.mouseX = ev.clientX; this.mouseY = ev.clientY;
if (this.isDragging) { return;
} this.isDragging = true;
module.exports = Draggable; // we should listen to "mousemove" to handle the pointer position changes. this.draggableEl.current.addEventListener("mousemove", this.onMove); this.draggableEl.current.setPointerCapture(ev.pointerId); this.draggableEl.current.addEventListener( "mousedown",
event => event.preventDefault(),
{ once: true }
);
this.props.onStart && this.props.onStart();
}
onDoubleClick() { if (this.props.onDoubleClick) { this.props.onDoubleClick();
}
}
onMove(ev) { if (!this.isDragging) { return;
}
ev.preventDefault(); // Use viewport coordinates so, moving mouse over iframes // doesn't mangle (relative) coordinates. this.props.onMove(ev.clientX, ev.clientY);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.