Browse Source

fix: prevent middle click paste on linux

Konstantinos Kaloutas 3 years ago
parent
commit
3ae3d4efa0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tldraw/packages/core/src/lib/TLApp/TLApp.ts

+ 7 - 0
tldraw/packages/core/src/lib/TLApp/TLApp.ts

@@ -851,6 +851,13 @@ export class TLApp<
   }
 
   readonly onPointerUp: TLEvents<S, K>['pointer'] = (info, e) => {
+    if (!this.editingShape && e.button === 1 && this.isIn('move')) {
+      this.selectedTool.transition('idle', { exit: true })
+      e.stopPropagation()
+      e.preventDefault()
+      return
+    }
+
     if ('clientX' in e) {
       this.inputs.onPointerUp(
         [...this.viewport.getPagePoint([e.clientX, e.clientY]), 0.5],