Bladeren bron

fix: keep native copy inside text fields during excel selection

Co-authored-by: Cursor <cursoragent@cursor.com>
wuzilong 1 week geleden
bovenliggende
commit
52d94b94dd
1 gewijzigde bestanden met toevoegingen van 10 en 0 verwijderingen
  1. 10 0
      web-admin/src/components/business/list-table/index.vue

+ 10 - 0
web-admin/src/components/business/list-table/index.vue

@@ -356,8 +356,18 @@
     }
   }
 
+  function isTextEntryTarget(target: EventTarget | null): boolean {
+    if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true
+    if (target instanceof HTMLInputElement) {
+      const type = (target.getAttribute('type') || 'text').toLowerCase()
+      return type !== 'checkbox' && type !== 'radio'
+    }
+    return target instanceof HTMLElement && target.isContentEditable
+  }
+
   function onKeydown(event: KeyboardEvent) {
     if (!excelMode.value || !props.excelCopy) return
+    if (isTextEntryTarget(event.target)) return
     const root = tableRoot()
     const panel = root?.closest('.panel')
     const target = event.target as Node | null