disable copying valueless cell

This commit is contained in:
shamsmosowi
2022-06-06 21:54:13 +10:00
parent d729607ab3
commit 21576b2b57
2 changed files with 8 additions and 3 deletions

View File

@@ -18,12 +18,11 @@ export default function ContextMenuItem({
onClick,
icon,
label,
disabled,
hotkeyLabel,
...props
}: IContextMenuItem) {
return (
<MenuItem {...props} disabled={disabled} onClick={onClick}>
<MenuItem {...props} onClick={onClick}>
<ListItemIcon>{icon}</ListItemIcon>
<ListItemText>{label}</ListItemText>
{hotkeyLabel && (

View File

@@ -92,7 +92,13 @@ export const BasicContextMenuActions: IFieldConfig["contextMenuActions"] = (
const contextMenuActions = [
// { label: "Cut", icon: <Cut />, onClick: handleCut },
{ label: "Copy", icon: <CopyCells />, onClick: handleCopy },
{
label: "Copy",
icon: <CopyCells />,
onClick: handleCopy,
disabled:
cellValue === undefined || cellValue === null || cellValue === "",
},
{ label: "Paste", icon: <Paste />, onClick: handlePaste },
];