svelte-dnd-action 0.9.42 → 0.9.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1673,11 +1673,16 @@
1673
1673
  window.removeEventListener("mouseup", handleFalseAlarm);
1674
1674
  window.removeEventListener("touchend", handleFalseAlarm);
1675
1675
  }
1676
- function handleFalseAlarm() {
1676
+ function handleFalseAlarm(e) {
1677
1677
  removeMaybeListeners();
1678
1678
  originalDragTarget = undefined;
1679
1679
  dragStartMousePosition = undefined;
1680
1680
  currentMousePosition = undefined;
1681
+
1682
+ // dragging initiated by touch events prevents onclick from initially firing
1683
+ if (e.type === "touchend") {
1684
+ e.target.click();
1685
+ }
1681
1686
  }
1682
1687
  function handleMouseMoveMaybeDragStart(e) {
1683
1688
  e.preventDefault();
@@ -1712,6 +1717,7 @@
1712
1717
  });
1713
1718
  return;
1714
1719
  }
1720
+ e.preventDefault();
1715
1721
  e.stopPropagation();
1716
1722
  var c = e.touches ? e.touches[0] : e;
1717
1723
  dragStartMousePosition = {
package/dist/index.mjs CHANGED
@@ -1667,11 +1667,16 @@ function dndzone(node, options) {
1667
1667
  window.removeEventListener("mouseup", handleFalseAlarm);
1668
1668
  window.removeEventListener("touchend", handleFalseAlarm);
1669
1669
  }
1670
- function handleFalseAlarm() {
1670
+ function handleFalseAlarm(e) {
1671
1671
  removeMaybeListeners();
1672
1672
  originalDragTarget = undefined;
1673
1673
  dragStartMousePosition = undefined;
1674
1674
  currentMousePosition = undefined;
1675
+
1676
+ // dragging initiated by touch events prevents onclick from initially firing
1677
+ if (e.type === "touchend") {
1678
+ e.target.click();
1679
+ }
1675
1680
  }
1676
1681
  function handleMouseMoveMaybeDragStart(e) {
1677
1682
  e.preventDefault();
@@ -1706,6 +1711,7 @@ function dndzone(node, options) {
1706
1711
  });
1707
1712
  return;
1708
1713
  }
1714
+ e.preventDefault();
1709
1715
  e.stopPropagation();
1710
1716
  var c = e.touches ? e.touches[0] : e;
1711
1717
  dragStartMousePosition = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svelte-dnd-action",
3
3
  "description": "*An awesome drag and drop library for Svelte 3 and 4 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *",
4
- "version": "0.9.42",
4
+ "version": "0.9.44",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
@@ -52,7 +52,7 @@
52
52
  "rollup-plugin-copy": "^3.3.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "svelte": ">=3.23.0"
55
+ "svelte": ">=3.23.0 || ^5.0.0-next.0"
56
56
  },
57
57
  "keywords": [
58
58
  "svelte",
@@ -350,11 +350,16 @@ export function dndzone(node, options) {
350
350
  window.removeEventListener("mouseup", handleFalseAlarm);
351
351
  window.removeEventListener("touchend", handleFalseAlarm);
352
352
  }
353
- function handleFalseAlarm() {
353
+ function handleFalseAlarm(e) {
354
354
  removeMaybeListeners();
355
355
  originalDragTarget = undefined;
356
356
  dragStartMousePosition = undefined;
357
357
  currentMousePosition = undefined;
358
+
359
+ // dragging initiated by touch events prevents onclick from initially firing
360
+ if (e.type === "touchend") {
361
+ e.target.click();
362
+ }
358
363
  }
359
364
 
360
365
  function handleMouseMoveMaybeDragStart(e) {
@@ -384,6 +389,7 @@ export function dndzone(node, options) {
384
389
  printDebug(() => "cannot start a new drag before finalizing previous one");
385
390
  return;
386
391
  }
392
+ e.preventDefault();
387
393
  e.stopPropagation();
388
394
  const c = e.touches ? e.touches[0] : e;
389
395
  dragStartMousePosition = {x: c.clientX, y: c.clientY};