Skip to content

Commit

Permalink
[data grid] Fix Unable to Paste Row Data in Data Grid with CAPS Lock …
Browse files Browse the repository at this point in the history
…Key Enabled (#11965)
  • Loading branch information
shaharyar-shamshi authored Feb 7, 2024
1 parent e304266 commit 221e84a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,15 @@ function defaultPasteResolver({
});
}

function isPasteShortcut(event: React.KeyboardEvent) {
return (event.ctrlKey || event.metaKey) && event.key === 'v';
}
const isPasteShortcut = (event: React.KeyboardEvent) => {
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'v') {
if (event.shiftKey || event.altKey) {
return false;
}
return true;
}
return false;
};

export const useGridClipboardImport = (
apiRef: React.MutableRefObject<GridPrivateApiPremium>,
Expand Down

0 comments on commit 221e84a

Please sign in to comment.