Skip to content

Commit

Permalink
remove existing event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfunkhouser committed May 6, 2022
1 parent 6a82dbb commit ea411d2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/dragelement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ dragElement.init = function init(options) {
initialTarget,
rightClick;

if(options.dragmode === false) {
if(element.onmousedown) {
element.onmousedown = undefined;
}
if(!supportsPassive) {
if(element.ontouchstart) {
element.ontouchstart = undefined;
}
} else {
if(element._ontouchstart) {
element.removeEventListener('touchstart', element._ontouchstart);
element._ontouchstart = undefined;
}
}
return;
}

if(!gd._mouseDownTime) gd._mouseDownTime = 0;

element.style.pointerEvents = 'all';
Expand Down

0 comments on commit ea411d2

Please sign in to comment.