From 558ee2d86bd06c4d84a13b1f7976825c2002d444 Mon Sep 17 00:00:00 2001 From: Yuichi Shundo Date: Tue, 26 Jun 2018 12:55:19 +0900 Subject: [PATCH] fix: selecting events in chrome (#884) * fix selecting events in chrome * add comment. --- src/Selection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Selection.js b/src/Selection.js index 097acd715..d3f2188a2 100644 --- a/src/Selection.js +++ b/src/Selection.js @@ -322,6 +322,12 @@ class Selection { top = Math.min(pageY, y), old = this.selecting + // Prevent emitting selectStart event until mouse is moved. + // in Chrome on Windows, mouseMove event may be fired just after mouseDown event. + if (!old && !(w || h)) { + return + } + this.selecting = true this._selectRect = { top,