svelte-dnd-action 0.9.57 → 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 +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
- package/src/pointerAction.js +7 -7
package/dist/index.js
CHANGED
|
@@ -1822,19 +1822,19 @@
|
|
|
1822
1822
|
|
|
1823
1823
|
// creating the draggable element
|
|
1824
1824
|
draggedEl = createDraggedElementFrom(originalDragTarget, centreDraggedOnCursor && currentMousePosition);
|
|
1825
|
-
|
|
1826
|
-
|
|
1825
|
+
originDropZoneRoot.appendChild(draggedEl);
|
|
1827
1826
|
// We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after the framework removes it
|
|
1828
1827
|
function keepOriginalElementInDom() {
|
|
1829
|
-
if (!
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1828
|
+
if (!originalDragTarget.parentElement) {
|
|
1829
|
+
originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
|
|
1830
|
+
originDropZoneRoot.appendChild(originalDragTarget);
|
|
1831
|
+
// have to watch before we hide, otherwise Svelte 5 $state gets confused
|
|
1833
1832
|
watchDraggedElement();
|
|
1834
1833
|
hideElement(originalDragTarget);
|
|
1835
|
-
originDropZoneRoot.appendChild(originalDragTarget);
|
|
1836
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
|
|
1837
1835
|
shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
|
|
1836
|
+
// to prevent the outline from disappearing
|
|
1837
|
+
draggedEl.focus();
|
|
1838
1838
|
} else {
|
|
1839
1839
|
window.requestAnimationFrame(keepOriginalElementInDom);
|
|
1840
1840
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1816,19 +1816,19 @@ function dndzone$2(node, options) {
|
|
|
1816
1816
|
|
|
1817
1817
|
// creating the draggable element
|
|
1818
1818
|
draggedEl = createDraggedElementFrom(originalDragTarget, centreDraggedOnCursor && currentMousePosition);
|
|
1819
|
-
|
|
1820
|
-
|
|
1819
|
+
originDropZoneRoot.appendChild(draggedEl);
|
|
1821
1820
|
// We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after the framework removes it
|
|
1822
1821
|
function keepOriginalElementInDom() {
|
|
1823
|
-
if (!
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1822
|
+
if (!originalDragTarget.parentElement) {
|
|
1823
|
+
originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
|
|
1824
|
+
originDropZoneRoot.appendChild(originalDragTarget);
|
|
1825
|
+
// have to watch before we hide, otherwise Svelte 5 $state gets confused
|
|
1827
1826
|
watchDraggedElement();
|
|
1828
1827
|
hideElement(originalDragTarget);
|
|
1829
|
-
originDropZoneRoot.appendChild(originalDragTarget);
|
|
1830
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
|
|
1831
1829
|
shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
|
|
1830
|
+
// to prevent the outline from disappearing
|
|
1831
|
+
draggedEl.focus();
|
|
1832
1832
|
} else {
|
|
1833
1833
|
window.requestAnimationFrame(keepOriginalElementInDom);
|
|
1834
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.
|
|
4
|
+
"version": "0.9.59",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
|
package/src/pointerAction.js
CHANGED
|
@@ -433,19 +433,19 @@ export function dndzone(node, options) {
|
|
|
433
433
|
|
|
434
434
|
// creating the draggable element
|
|
435
435
|
draggedEl = createDraggedElementFrom(originalDragTarget, centreDraggedOnCursor && currentMousePosition);
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
originDropZoneRoot.appendChild(draggedEl);
|
|
438
437
|
// We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after the framework removes it
|
|
439
438
|
function keepOriginalElementInDom() {
|
|
440
|
-
if (!
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
439
|
+
if (!originalDragTarget.parentElement) {
|
|
440
|
+
originalDragTarget.setAttribute(ORIGINAL_DRAGGED_ITEM_MARKER_ATTRIBUTE, true);
|
|
441
|
+
originDropZoneRoot.appendChild(originalDragTarget);
|
|
442
|
+
// have to watch before we hide, otherwise Svelte 5 $state gets confused
|
|
444
443
|
watchDraggedElement();
|
|
445
444
|
hideElement(originalDragTarget);
|
|
446
|
-
originDropZoneRoot.appendChild(originalDragTarget);
|
|
447
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
|
|
448
446
|
shadowElData[ITEM_ID_KEY] = draggedElData[ITEM_ID_KEY];
|
|
447
|
+
// to prevent the outline from disappearing
|
|
448
|
+
draggedEl.focus();
|
|
449
449
|
} else {
|
|
450
450
|
window.requestAnimationFrame(keepOriginalElementInDom);
|
|
451
451
|
}
|