fix(connectionLine): add container bounds

This commit is contained in:
moklick
2019-07-31 11:48:16 +02:00
parent 2d5e2d9241
commit 191bc11253
5 changed files with 15 additions and 31 deletions
-7
View File
@@ -29,12 +29,6 @@ const getHandleBounds = (sel, nodeElement, parentBounds, k) => {
};
};
const onDragOver = evt => {
evt.preventDefault();
evt.dataTransfer.dropEffect = 'move';
}
export default NodeComponent => memo((props) => {
const nodeElement = useRef(null);
const { state, dispatch } = useContext(GraphContext);
@@ -113,7 +107,6 @@ export default NodeComponent => memo((props) => {
scale={k}
>
<div
onDragOver={onDragOver}
className={nodeClasses}
ref={nodeElement}
style={{ zIndex: selected ? 10 : 3, transform: `translate(${position.x}px,${position.y}px)` }}