Disable pasting for readonly cells

This commit is contained in:
Andrew Kingston 2023-04-21 10:57:45 +01:00
parent aa98cf72f5
commit f8a9af2458
2 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,9 @@
clipboard.actions.copy()
break
case "v":
clipboard.actions.paste()
if (!api?.isReadonly()) {
clipboard.actions.paste()
}
break
}
} else {

View File

@ -13,6 +13,7 @@
copiedCell,
clipboard,
dispatch,
focusedCellAPI,
} = getContext("grid")
$: style = makeStyle($menu)
@ -49,7 +50,7 @@
</MenuItem>
<MenuItem
icon="Paste"
disabled={$copiedCell == null}
disabled={$copiedCell == null || $focusedCellAPI?.isReadonly()}
on:click={clipboard.actions.paste}
on:click={menu.actions.close}
>