浏览代码

fix: copy blocks not working

Ahmad Kholid 2 年之前
父节点
当前提交
6aa62530c0
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/newtab/pages/workflows/[id].vue

+ 4 - 2
src/newtab/pages/workflows/[id].vue

@@ -1510,12 +1510,14 @@ function undoRedoCommand(type, { target }) {
 
 
   executeCommand(type);
   executeCommand(type);
 }
 }
-function onKeydown({ ctrlKey, metaKey, shiftKey, key, target }) {
+function onKeydown({ ctrlKey, metaKey, shiftKey, key, target, repeat }) {
+  if (repeat) return;
+
   const els = ['INPUT', 'SELECT', 'TEXTAREA'];
   const els = ['INPUT', 'SELECT', 'TEXTAREA'];
   if (
   if (
     els.includes(target.tagName) ||
     els.includes(target.tagName) ||
     target.isContentEditable ||
     target.isContentEditable ||
-    !target.classList.contains('workflow-editor')
+    !target.closest('.workflow-editor')
   )
   )
     return;
     return;