Disable pasting for readonly cells
This commit is contained in:
parent
aa98cf72f5
commit
f8a9af2458
|
@ -54,7 +54,9 @@
|
||||||
clipboard.actions.copy()
|
clipboard.actions.copy()
|
||||||
break
|
break
|
||||||
case "v":
|
case "v":
|
||||||
clipboard.actions.paste()
|
if (!api?.isReadonly()) {
|
||||||
|
clipboard.actions.paste()
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
copiedCell,
|
copiedCell,
|
||||||
clipboard,
|
clipboard,
|
||||||
dispatch,
|
dispatch,
|
||||||
|
focusedCellAPI,
|
||||||
} = getContext("grid")
|
} = getContext("grid")
|
||||||
|
|
||||||
$: style = makeStyle($menu)
|
$: style = makeStyle($menu)
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="Paste"
|
icon="Paste"
|
||||||
disabled={$copiedCell == null}
|
disabled={$copiedCell == null || $focusedCellAPI?.isReadonly()}
|
||||||
on:click={clipboard.actions.paste}
|
on:click={clipboard.actions.paste}
|
||||||
on:click={menu.actions.close}
|
on:click={menu.actions.close}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue