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:
1 parent
2b5300722f
commit
0b07f05f72
1 file changed
+3
@@ -4016,6 +4016,8 @@ function pasteTextIntoSelection(text: string): boolean {
|
|||||||
|
|
||||||
function onGridPaste(event: ClipboardEvent) {
|
function onGridPaste(event: ClipboardEvent) {
|
||||||
if (!props.editable || (!selectedRange.value && !hasColumnSelection.value)) return;
|
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");
|
const text = event.clipboardData?.getData("text/plain");
|
||||||
if (text === undefined) return;
|
if (text === undefined) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -7482,6 +7484,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||||||
|
|
||||||
<TabsContent value="details" class="m-0 min-h-0 flex-1 flex flex-col">
|
<TabsContent value="details" class="m-0 min-h-0 flex-1 flex flex-col">
|
||||||
<div
|
<div
|
||||||
|
data-native-clipboard
|
||||||
class="flex-1 min-h-0 overflow-auto p-3 text-xs"
|
class="flex-1 min-h-0 overflow-auto p-3 text-xs"
|
||||||
:class="
|
:class="
|
||||||
cellDetailPanelIsBottom ? 'grid grid-cols-[minmax(0,1fr)_minmax(220px,30%)] gap-3' : 'space-y-3'
|
cellDetailPanelIsBottom ? 'grid grid-cols-[minmax(0,1fr)_minmax(220px,30%)] gap-3' : 'space-y-3'
|
||||||
|
|||||||
Reference in new issue
Block a user