From a90503f20cbef2c14706d6c3a2f8e70e1553177d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 2 Feb 2021 02:34:39 +0100 Subject: [PATCH] Always remove drag events. Closes #4 --- src/Handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Handler.js b/src/Handler.js index 38bccbf..e3c9054 100644 --- a/src/Handler.js +++ b/src/Handler.js @@ -195,13 +195,13 @@ export default class Handler { isDef(e.button) && e.which === 0 && stopDrag(e); }; const stopDrag = e => { + off(document, eventMove, drag); + off(document, eventUp, stopDrag); if (!dragged) { return; } dragged = 0; this.setPosition(pos); - off(document, eventMove, drag); - off(document, eventUp, stopDrag); this.emit('handler:drag:end', this, pos); }; const initDrag = e => {