svelte-dnd-action 0.9.58 → 0.9.59

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
@@ -1828,12 +1828,13 @@
1828
1828
  if (!originalDragTarget.parentElement) {
1829
1829
  originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
1830
1830
  originDropZoneRoot.appendChild(originalDragTarget);
1831
+ // have to watch before we hide, otherwise Svelte 5 $state gets confused
1832
+ watchDraggedElement();
1831
1833
  hideElement(originalDragTarget);
1832
1834
  // after the removal of the original element we can give the shadow element the original item id so that the host zone can find it and render it correctly if it does lookups by id
1833
1835
  shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
1834
1836
  // to prevent the outline from disappearing
1835
1837
  draggedEl.focus();
1836
- watchDraggedElement();
1837
1838
  } else {
1838
1839
  window.requestAnimationFrame(keepOriginalElementInDom);
1839
1840
  }
package/dist/index.mjs CHANGED
@@ -1822,12 +1822,13 @@ function dndzone$2(node, options) {
1822
1822
  if (!originalDragTarget.parentElement) {
1823
1823
  originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
1824
1824
  originDropZoneRoot.appendChild(originalDragTarget);
1825
+ // have to watch before we hide, otherwise Svelte 5 $state gets confused
1826
+ watchDraggedElement();
1825
1827
  hideElement(originalDragTarget);
1826
1828
  // after the removal of the original element we can give the shadow element the original item id so that the host zone can find it and render it correctly if it does lookups by id
1827
1829
  shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
1828
1830
  // to prevent the outline from disappearing
1829
1831
  draggedEl.focus();
1830
- watchDraggedElement();
1831
1832
  } else {
1832
1833
  window.requestAnimationFrame(keepOriginalElementInDom);
1833
1834
  }
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.58",
4
+ "version": "0.9.59",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
@@ -439,12 +439,13 @@ export function dndzone(node, options) {
439
439
  if (!originalDragTarget.parentElement) {
440
440
  originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
441
441
  originDropZoneRoot.appendChild(originalDragTarget);
442
+ // have to watch before we hide, otherwise Svelte 5 $state gets confused
443
+ watchDraggedElement();
442
444
  hideElement(originalDragTarget);
443
445
  // after the removal of the original element we can give the shadow element the original item id so that the host zone can find it and render it correctly if it does lookups by id
444
446
  shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
445
447
  // to prevent the outline from disappearing
446
448
  draggedEl.focus();
447
- watchDraggedElement();
448
449
  } else {
449
450
  window.requestAnimationFrame(keepOriginalElementInDom);
450
451
  }