|
|
|
@ -173,8 +173,16 @@ const getContainerScrollForElement = (
|
|
|
|
|
return scroll |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCellClick, clearSelectedRange, copyValue } = |
|
|
|
|
useMultiSelect( |
|
|
|
|
const { |
|
|
|
|
isCellSelected, |
|
|
|
|
activeCell, |
|
|
|
|
handleMouseDown, |
|
|
|
|
handleMouseOver, |
|
|
|
|
handleCellClick, |
|
|
|
|
clearSelectedRange, |
|
|
|
|
copyValue, |
|
|
|
|
isCellActive, |
|
|
|
|
} = useMultiSelect( |
|
|
|
|
meta, |
|
|
|
|
fields, |
|
|
|
|
data, |
|
|
|
@ -202,7 +210,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
|
const altOrOptionKey = e.altKey |
|
|
|
|
if (e.key === ' ') { |
|
|
|
|
if (activeCell.row != null && !isNaN(activeCell.row) && !editEnabled && hasEditPermission) { |
|
|
|
|
if (isCellActive.value && !editEnabled && hasEditPermission) { |
|
|
|
|
e.preventDefault() |
|
|
|
|
clearSelectedRange() |
|
|
|
|
const row = data.value[activeCell.row] |
|
|
|
@ -226,7 +234,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (cmdOrCtrl) { |
|
|
|
|
if (activeCell.row === null || isNaN(activeCell.row) || activeCell.col === null || isNaN(activeCell.col)) return |
|
|
|
|
if (!isCellActive.value) return |
|
|
|
|
|
|
|
|
|
switch (e.key) { |
|
|
|
|
case 'ArrowUp': |
|
|
|
@ -296,7 +304,7 @@ const { isCellSelected, activeCell, handleMouseDown, handleMouseOver, handleCell
|
|
|
|
|
// update/save cell value |
|
|
|
|
await updateOrSaveRow(rowObj, ctx.updatedColumnTitle || columnObj.title) |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
function scrollToCell(row?: number | null, col?: number | null) { |
|
|
|
|
row = row ?? activeCell.row |
|
|
|
|