fix(ui): fix offset check

This commit is contained in:
nick-delirium 2023-02-08 14:39:22 +01:00
parent 41537cc77b
commit 08c51a0b4a

View file

@ -25,7 +25,7 @@ function getItemStyles(
display: "none"
}
}
let { x, y } = currentOffset;
let { x } = currentOffset;
if (x > maxX) {
x = maxX;
}
@ -61,7 +61,7 @@ const CustomDragLayer: FC<Props> = memo(function CustomDragLayer({ maxX, minX, o
}))
useEffect(() => {
if (!isDragging || !currentOffset) {
if (!isDragging || !currentOffset?.x) {
return
}
onDrag(currentOffset)