Procházet zdrojové kódy

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

David Luzar před 5 roky
rodič
revize
e0deb68875
1 změnil soubory, kde provedl 5 přidání a 3 odebrání
  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 -