fix removePoppersOnDrag

This commit is contained in:
nflnkr 2024-01-10 21:28:52 +03:00
parent c673b5be9f
commit d565a50a66

@ -82,16 +82,23 @@ function CsComponent() {
if (!cy) return; if (!cy) return;
let isPointerDown = false; let isPointerDown = false;
let isDragging = false;
const onPointerDown = () => { const onPointerDown = () => {
isPointerDown = true; isPointerDown = true;
}; };
const onPointerUp = () => { const onPointerUp = () => {
if (isPointerDown) recreatePoppers(); if (isDragging) {
isDragging = false;
recreatePoppers();
}
isPointerDown = false; isPointerDown = false;
}; };
const handleMove = () => { const handleMove = () => {
if (isPointerDown) removeAllPoppers(); if (isPointerDown) {
isDragging = true;
removeAllPoppers();
}
}; };
cy.on("vmousedown", onPointerDown); cy.on("vmousedown", onPointerDown);