Browse Source

fix: copy blocks not working

Ahmad Kholid 2 years ago
parent
commit
6aa62530c0
1 changed files with 4 additions and 2 deletions
  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);
 }
-function onKeydown({ ctrlKey, metaKey, shiftKey, key, target }) {
+function onKeydown({ ctrlKey, metaKey, shiftKey, key, target, repeat }) {
+  if (repeat) return;
+
   const els = ['INPUT', 'SELECT', 'TEXTAREA'];
   if (
     els.includes(target.tagName) ||
     target.isContentEditable ||
-    !target.classList.contains('workflow-editor')
+    !target.closest('.workflow-editor')
   )
     return;