Skip to content

Commit

Permalink
Merge pull request #1473 from janvi01/pasteFilterBug
Browse files Browse the repository at this point in the history
fix: while pasting updates the value of the cell if highlighted
  • Loading branch information
shamsmosowi authored Nov 7, 2023
2 parents 3616326 + 7e68794 commit b64bdbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Table/useMenuAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +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")) {
Expand Down

0 comments on commit b64bdbc

Please sign in to comment.