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

This commit is contained in:
dwelle 2020-01-04 14:28:43 +01:00
parent 2d0934fdd9
commit 2e44fe2789

View file

@ -963,9 +963,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 -