fix(grid): allow native copy for transposed field names

This commit is contained in:
二丫讲梵 2026-07-30 00:09:01 +08:00 committed by GitHub
parent 62130938cf
commit 5d7ebb5c96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -8003,6 +8003,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
<template #default="{ item, index }">
<div class="data-grid-transpose-row flex border-b border-border/60" :style="{ height: '30px', width: `${transposeTotalWidth}px` }">
<div
data-native-clipboard
class="sticky left-0 z-10 flex shrink-0 items-center border-r border-border bg-background px-3 py-0 font-medium truncate"
:class="{
'bg-yellow-200/60 dark:bg-yellow-500/20': transposeHeaderIsSearchMatch(visibleColumnIndexes[index]),

View File

@ -7,4 +7,8 @@ describe("DataGrid native clipboard regions", () => {
it("keeps table info text selection out of grid copy shortcuts", () => {
expect(dataGridSource).toMatch(/<div\b(?=[^>]*\bv-if="showTableInfo")(?=[^>]*\bdata-native-clipboard)[^>]*>/);
});
it("keeps transposed field-name text selection out of grid copy shortcuts", () => {
expect(dataGridSource).toMatch(/<div\b(?=[^>]*\bdata-native-clipboard)(?=[^>]*:title="item\.column")[^>]*>/);
});
});