I have an idea that when I drag an element, it can be "adsorbed" when it is close to another element.
I try to judge whether the distance is less than the fixed value on the onDrag, set the grid and position when approaching, and cancel the grid when leaving. But I failed. Setting the position seems to have no effect. I don't know why. At the same time, the grid doesn't seem to be perfectly aligned
@neodrag/svelte: 2.0.3
I have an idea that when I drag an element, it can be "adsorbed" when it is close to another element. I try to judge whether the distance is less than the fixed value on the
onDrag
, set thegrid
andposition
when approaching, and cancel thegrid
when leaving. But I failed. Setting theposition
seems to have no effect. I don't know why. At the same time, the grid doesn't seem to be perfectly aligned@neodrag/svelte: 2.0.3