diff --git a/src/Utils/dragDetection.ts b/src/Utils/dragDetection.ts
new file mode 100644
index 000000000..368c4b6e1
--- /dev/null
+++ b/src/Utils/dragDetection.ts
@@ -0,0 +1,36 @@
+export function dragDetection(htmlElement: HTMLElement, callback: () => {}) {
+
+ let isDown = false
+ let threshold = 5
+ let start = null
+
+ htmlElement.addEventListener("pointerdown", (e) => {
+ isDown = true
+ start = { x: e.clientX, y: e.clientY }
+ })
+
+ htmlElement.addEventListener("pointermove", (e) => {
+ if (!isDown || !start) return
+ const dx = e.clientX - start.x
+ const dy = e.clientY - start.y
+ if (Math.hypot(dx, dy) > threshold) {
+ callback()
+ isDown = false
+ }
+ })
+
+ htmlElement.addEventListener("pointerup", () => {
+ isDown = false
+ start = null
+ })
+
+ htmlElement.addEventListener("pointerleave", () => {
+ isDown = false
+ start = null
+ })
+
+ return {
+ destroy: () => {
+ },
+ }
+}