- setDragging({
- icon: this.dataset['icon'],
- x: (e.x - bounds.x) / bounds.width,
- y: (e.y - bounds.y) / bounds.height,
- });
+ const distance = Math.max(Math.abs(e.x - start.x), Math.abs(e.y - start.y));
+ if (distance > 5) {
+ setDragging({
+ icon: this.dataset['icon'],
+ x: (e.x - bounds.x) / bounds.width,
+ y: (e.y - bounds.y) / bounds.height,
+ });
+ } else {
+ setDragging(null);
+ }