Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

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

David Luzare0deb68875af
diff --git a/src/index.tsx b/src/index.tsx
index 85483ba5b6..a7d97c9efd 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 -