Преглед изворни кода

fix(web): remove processing key events in photo viewer window (#3238)

Harry Tran пре 2 година
родитељ
комит
48c9cfb432
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      web/src/lib/components/asset-viewer/photo-viewer.svelte

+ 3 - 0
web/src/lib/components/asset-viewer/photo-viewer.svelte

@@ -45,6 +45,9 @@
   };
 
   const handleKeypress = async ({ metaKey, ctrlKey, key }: KeyboardEvent) => {
+    if (window.getSelection()?.type === 'Range') {
+      return;
+    }
     if ((metaKey || ctrlKey) && key === 'c') {
       await doCopy();
     }