fix: Firefox swallows mouse up when dragging to resize video
This commit is contained in:
@@ -44,7 +44,7 @@ const Image = (props: Props) => {
|
|||||||
maxWidth,
|
maxWidth,
|
||||||
naturalWidth,
|
naturalWidth,
|
||||||
naturalHeight,
|
naturalHeight,
|
||||||
gridWidth: documentBounds.width / 10,
|
gridWidth: documentBounds.width / 20,
|
||||||
onChangeSize,
|
onChangeSize,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default function Video(props: Props) {
|
|||||||
maxWidth: documentBounds.width,
|
maxWidth: documentBounds.width,
|
||||||
naturalWidth,
|
naturalWidth,
|
||||||
naturalHeight,
|
naturalHeight,
|
||||||
gridWidth: documentBounds.width / 10,
|
gridWidth: documentBounds.width / 20,
|
||||||
onChangeSize,
|
onChangeSize,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -41,9 +41,10 @@ export default function Video(props: Props) {
|
|||||||
}
|
}
|
||||||
}, [node.attrs.width]);
|
}, [node.attrs.width]);
|
||||||
|
|
||||||
const style = {
|
const style: React.CSSProperties = {
|
||||||
width: width || "auto",
|
width: width || "auto",
|
||||||
maxHeight: height || "auto",
|
maxHeight: height || "auto",
|
||||||
|
pointerEvents: dragging ? "none" : "all",
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -56,7 +57,7 @@ export default function Video(props: Props) {
|
|||||||
src={sanitizeUrl(node.attrs.src)}
|
src={sanitizeUrl(node.attrs.src)}
|
||||||
title={node.attrs.title}
|
title={node.attrs.title}
|
||||||
style={style}
|
style={style}
|
||||||
controls
|
controls={!dragging}
|
||||||
/>
|
/>
|
||||||
{isEditable && isResizable && (
|
{isEditable && isResizable && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user