Skip to content

Commit

Permalink
CB-4699 fix: prevent cell copy in editing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Apr 11, 2024
1 parent 530af6d commit 058631e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ export function useGridSelectedCellsCopy(

const onKeydownHandler = useCallback((event: React.KeyboardEvent) => {
if ((event.ctrlKey || event.metaKey) && event.nativeEvent.code === EVENT_KEY_CODE.C) {
const activeElement = document.activeElement as HTMLElement | null;
if (
activeElement?.getAttribute('role') !== 'gridcell' &&
activeElement?.getAttribute('role') !== 'columnheader' &&
event.target !== event.currentTarget
) {
return;
}
EventContext.set(event, EventStopPropagationFlag);

if (dataViewerService.canCopyData) {
Expand Down

0 comments on commit 058631e

Please sign in to comment.