Skip to content

Commit

Permalink
Merge pull request #406 from 27pchrisl/safari-text-selection
Browse files Browse the repository at this point in the history
Fix issue where Safari attempts to select text during drag operations
  • Loading branch information
jerosoler committed May 2, 2022
2 parents 4a60696 + 63c2688 commit 1ecd7a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/drawflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default class Drawflow {
this.dispatch('click', e);
if(this.editor_mode === 'fixed') {
//return false;
e.preventDefault();
if(e.target.classList[0] === 'parent-drawflow' || e.target.classList[0] === 'drawflow') {
this.ele_selected = e.target.closest(".parent-drawflow");
} else {
Expand Down Expand Up @@ -325,6 +326,9 @@ export default class Drawflow {
this.pos_y = e.clientY;
this.pos_y_start = e.clientY;
}
if (this.drag || ['input','output','main-path'].includes(this.ele_selected.classList[0])) {
e.preventDefault();
}
this.dispatch('clickEnd', e);
}

Expand Down

0 comments on commit 1ecd7a8

Please sign in to comment.