Skip to content

Commit 558ee2d

Browse files
shundyjquense
authored andcommitted
fix: selecting events in chrome (jquense#884)
* fix selecting events in chrome * add comment.
1 parent f9b5d53 commit 558ee2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Selection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ class Selection {
322322
top = Math.min(pageY, y),
323323
old = this.selecting
324324

325+
// Prevent emitting selectStart event until mouse is moved.
326+
// in Chrome on Windows, mouseMove event may be fired just after mouseDown event.
327+
if (!old && !(w || h)) {
328+
return
329+
}
330+
325331
this.selecting = true
326332
this._selectRect = {
327333
top,

0 commit comments

Comments
 (0)