From e0deb68875afbb554ef0c46de6844a03bde4865c Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sat, 4 Jan 2020 15:22:08 +0100 Subject: [PATCH] ensure mouse drag doesn't select texts (#32) (#111) --- src/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 85483ba5b..a7d97c9ef 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -984,9 +984,11 @@ class App extends React.Component<{}, AppState> { })); }} onMouseDown={e => { - if (e.button !== 0) { - return; - } + // only handle left mouse button + if (e.button !== 0) return; + // fixes mousemove causing selection of UI texts #32 + e.preventDefault(); + const x = e.clientX - (e.target as HTMLElement).offsetLeft -