fix(grid): prevent grid from intercepting clipboard in native inputs and cell detail

- Add data-native-clipboard to cell detail panel so Cmd+C copies selected text
- Skip onGridPaste when event target is a native input element
This commit is contained in:
t8y2 committed 2026-06-06 20:49:32 +08:00
1 parent 2b5300722f
commit 0b07f05f72
1 file changed
+3
@@ -4016,6 +4016,8 @@ function pasteTextIntoSelection(text: string): boolean {
function onGridPaste(event: ClipboardEvent) {
if (!props.editable || (!selectedRange.value && !hasColumnSelection.value)) return;
const target = event.target as HTMLElement | null;
if (target?.closest("input, textarea, [contenteditable='true'], [role='textbox']")) return;
const text = event.clipboardData?.getData("text/plain");
if (text === undefined) return;
event.preventDefault();
@@ -7482,6 +7484,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
<TabsContent value="details" class="m-0 min-h-0 flex-1 flex flex-col">
<div
data-native-clipboard
class="flex-1 min-h-0 overflow-auto p-3 text-xs"
:class="
cellDetailPanelIsBottom ? 'grid grid-cols-[minmax(0,1fr)_minmax(220px,30%)] gap-3' : 'space-y-3'