Explorar o código

ensure mouse drag doesn't select texts (#32) (#111)

David Luzar %!s(int64=5) %!d(string=hai) anos
pai
achega
e0deb68875
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      src/index.tsx

+ 5 - 3
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 -