From 52d94b94ddc8477d3faa45fa0f4f0c9d0f1c2138 Mon Sep 17 00:00:00 2001 From: wuzilong <704541015@qq.com> Date: Mon, 19 Oct 2026 19:41:43 +0800 Subject: [PATCH] fix: keep native copy inside text fields during excel selection Co-authored-by: Cursor --- web-admin/src/components/business/list-table/index.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web-admin/src/components/business/list-table/index.vue b/web-admin/src/components/business/list-table/index.vue index 13365e703..e46c0ae2c 100644 --- a/web-admin/src/components/business/list-table/index.vue +++ b/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