Skip to content

Commit

Permalink
Always remove drag events. Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Feb 2, 2021
1 parent afc3e57 commit a90503f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit a90503f

Please sign in to comment.