From c17defab22f7d824273a349b978550ac5c4f1759 Mon Sep 17 00:00:00 2001 From: Yanislav Ivanov <93312843+yanisslav@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:11:38 +0200 Subject: [PATCH] feat: add cancel drag method (#56) --- src/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.js b/src/main.js index 741fc03..48e71ab 100644 --- a/src/main.js +++ b/src/main.js @@ -139,6 +139,12 @@ export class Draggable { }; } + cancelDrag() { + unbind(this.document, "pointermove", this._pointermove); + unbind(this.document, "pointerup", this._pointerup); + unbind(this.document, "pointercancel", this._pointerup); + } + bindTo(element) { if (element === this._element) { return;