fix: disable resizer for readonly editor

This commit is contained in:
thecodrr
2022-07-27 16:43:13 +05:00
parent cb89085671
commit 85228115b1

View File

@@ -13,6 +13,8 @@ type ResizerProps = {
export function Resizer(props: PropsWithChildren<ResizerProps>) {
const { editor, selected, onResize, width, height, children } = props;
if (!editor.isEditable) return <>{children}</>;
return (
<Resizable
enable={{
@@ -21,7 +23,7 @@ export function Resizer(props: PropsWithChildren<ResizerProps>) {
right: false,
top: false,
bottomLeft: false,
bottomRight: editor.isEditable && selected,
bottomRight: selected,
topLeft: false,
topRight: false,
}}