svelte-dnd-action 0.9.54 → 0.9.55

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
@@ -1633,7 +1633,11 @@
1633
1633
  source: SOURCES.POINTER
1634
1634
  });
1635
1635
  }
1636
- if (shadowElIdx !== -1) unDecorateShadowElement(shadowElDropZone.children[shadowElIdx]);
1636
+ // In edge cases the dom might have not been updated yet so we can't rely on data list index
1637
+ var domShadowEl = Array.from(shadowElDropZone.children).find(function (c) {
1638
+ return c.getAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME);
1639
+ });
1640
+ if (domShadowEl) unDecorateShadowElement(domShadowEl);
1637
1641
  cleanupPostDrop();
1638
1642
  }
1639
1643
  if (dzToConfig$1.get(shadowElDropZone).dropAnimationDisabled) {
package/dist/index.mjs CHANGED
@@ -1627,7 +1627,11 @@ function handleDrop$1() {
1627
1627
  source: SOURCES.POINTER
1628
1628
  });
1629
1629
  }
1630
- if (shadowElIdx !== -1) unDecorateShadowElement(shadowElDropZone.children[shadowElIdx]);
1630
+ // In edge cases the dom might have not been updated yet so we can't rely on data list index
1631
+ var domShadowEl = Array.from(shadowElDropZone.children).find(function (c) {
1632
+ return c.getAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME);
1633
+ });
1634
+ if (domShadowEl) unDecorateShadowElement(domShadowEl);
1631
1635
  cleanupPostDrop();
1632
1636
  }
1633
1637
  if (dzToConfig$1.get(shadowElDropZone).dropAnimationDisabled) {
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.54",
4
+ "version": "0.9.55",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
@@ -3,6 +3,7 @@ import {
3
3
  incrementActiveDropZoneCount,
4
4
  ITEM_ID_KEY,
5
5
  printDebug,
6
+ SHADOW_ELEMENT_ATTRIBUTE_NAME,
6
7
  SHADOW_ITEM_MARKER_PROPERTY_NAME,
7
8
  SHADOW_PLACEHOLDER_ITEM_ID,
8
9
  SOURCES,
@@ -114,7 +115,7 @@ function unWatchDraggedElement() {
114
115
  }
115
116
  window.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);
116
117
  // ensuring multiScroller is not already destroyed before destroying
117
- if(multiScroller) {
118
+ if (multiScroller) {
118
119
  multiScroller.destroy();
119
120
  multiScroller = undefined;
120
121
  }
@@ -271,7 +272,9 @@ function handleDrop() {
271
272
  source: SOURCES.POINTER
272
273
  });
273
274
  }
274
- if (shadowElIdx !== -1) unDecorateShadowElement(shadowElDropZone.children[shadowElIdx]);
275
+ // In edge cases the dom might have not been updated yet so we can't rely on data list index
276
+ const domShadowEl = Array.from(shadowElDropZone.children).find(c => c.getAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME));
277
+ if (domShadowEl) unDecorateShadowElement(domShadowEl);
275
278
  cleanupPostDrop();
276
279
  }
277
280
  if (dzToConfig.get(shadowElDropZone).dropAnimationDisabled) {