Skip to content

Commit 1ecd7a8

Browse files
authored
Merge pull request #406 from 27pchrisl/safari-text-selection
Fix issue where Safari attempts to select text during drag operations
2 parents 4a60696 + 63c2688 commit 1ecd7a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/drawflow.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export default class Drawflow {
177177
this.dispatch('click', e);
178178
if(this.editor_mode === 'fixed') {
179179
//return false;
180+
e.preventDefault();
180181
if(e.target.classList[0] === 'parent-drawflow' || e.target.classList[0] === 'drawflow') {
181182
this.ele_selected = e.target.closest(".parent-drawflow");
182183
} else {
@@ -325,6 +326,9 @@ export default class Drawflow {
325326
this.pos_y = e.clientY;
326327
this.pos_y_start = e.clientY;
327328
}
329+
if (this.drag || ['input','output','main-path'].includes(this.ele_selected.classList[0])) {
330+
e.preventDefault();
331+
}
328332
this.dispatch('clickEnd', e);
329333
}
330334

0 commit comments

Comments
 (0)