From 7e68794afb1aac7df430675b7b53464b5f6fbe09 Mon Sep 17 00:00:00 2001 From: janvi01 Date: Mon, 6 Nov 2023 16:52:07 +0530 Subject: [PATCH] added comment --- src/components/Table/useMenuAction.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Table/useMenuAction.tsx b/src/components/Table/useMenuAction.tsx index 6fc1b0bd..4cc20277 100644 --- a/src/components/Table/useMenuAction.tsx +++ b/src/components/Table/useMenuAction.tsx @@ -165,7 +165,10 @@ export function useMenuAction( async (e?: ClipboardEvent) => { try { if (!selectedCell || !selectedCol) return; + + // checks which element has focus, if it is not the gridcell it won't paste the copied content inside the gridcell if (document.activeElement?.role !== "gridcell") return; + let text: string; // Firefox doesn't allow for reading clipboard data, hence the workaround if (navigator.userAgent.includes("Firefox")) {