fix: Firefox swallows mouse up when dragging to resize video

This commit is contained in:
Tom Moor
2023-12-13 19:40:51 -05:00
parent 7dbdfcc823
commit ac75521c6c
2 changed files with 5 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ const Image = (props: Props) => {
maxWidth, maxWidth,
naturalWidth, naturalWidth,
naturalHeight, naturalHeight,
gridWidth: documentBounds.width / 10, gridWidth: documentBounds.width / 20,
onChangeSize, onChangeSize,
} }
); );

View File

@@ -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 && (
<> <>