Browse Source

fix: disable grid copy/paste if modal or drawer present

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5847/head
mertmit 1 year ago
parent
commit
51b6d1073a
  1. 11
      packages/nc-gui/composables/useMultiSelect/index.ts

11
packages/nc-gui/composables/useMultiSelect/index.ts

@ -11,6 +11,7 @@ import {
dateFormats, dateFormats,
extractPkFromRow, extractPkFromRow,
extractSdkResponseErrorMsg, extractSdkResponseErrorMsg,
isDrawerOrModalExist,
isMac, isMac,
isTypableInputColumn, isTypableInputColumn,
message, message,
@ -361,7 +362,11 @@ export function useMultiSelect(
const rowObj = unref(data)[activeCell.row] const rowObj = unref(data)[activeCell.row]
const columnObj = unref(fields)[activeCell.col] const columnObj = unref(fields)[activeCell.col]
if ((!unref(editEnabled) || !isTypableInputColumn(columnObj)) && (isMac() ? e.metaKey : e.ctrlKey)) { if (
(!unref(editEnabled) || !isTypableInputColumn(columnObj)) &&
!isDrawerOrModalExist() &&
(isMac() ? e.metaKey : e.ctrlKey)
) {
switch (e.keyCode) { switch (e.keyCode) {
// copy - ctrl/cmd +c // copy - ctrl/cmd +c
case 67: case 67:
@ -395,6 +400,10 @@ export function useMultiSelect(
const clearSelectedRange = selectedRange.clear.bind(selectedRange) const clearSelectedRange = selectedRange.clear.bind(selectedRange)
const handlePaste = async (e: ClipboardEvent) => { const handlePaste = async (e: ClipboardEvent) => {
if (isDrawerOrModalExist()) {
return
}
if (!isCellActive.value) { if (!isCellActive.value) {
return return
} }

Loading…
Cancel
Save