svelte-dnd-action 0.9.52 → 0.9.53

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
@@ -1432,8 +1432,11 @@
1432
1432
  _iterator2.f();
1433
1433
  }
1434
1434
  window.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop$1);
1435
- multiScroller.destroy();
1436
- multiScroller = undefined;
1435
+ // ensuring multiScroller is not already destroyed before destroying
1436
+ if (multiScroller) {
1437
+ multiScroller.destroy();
1438
+ multiScroller = undefined;
1439
+ }
1437
1440
  unobserve();
1438
1441
  }
1439
1442
  function findShadowElementIdx(items) {
package/dist/index.mjs CHANGED
@@ -1426,8 +1426,11 @@ function unWatchDraggedElement() {
1426
1426
  _iterator2.f();
1427
1427
  }
1428
1428
  window.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop$1);
1429
- multiScroller.destroy();
1430
- multiScroller = undefined;
1429
+ // ensuring multiScroller is not already destroyed before destroying
1430
+ if (multiScroller) {
1431
+ multiScroller.destroy();
1432
+ multiScroller = undefined;
1433
+ }
1431
1434
  unobserve();
1432
1435
  }
1433
1436
  function findShadowElementIdx(items) {
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.52",
4
+ "version": "0.9.53",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
@@ -113,8 +113,11 @@ function unWatchDraggedElement() {
113
113
  dz.removeEventListener(DRAGGED_OVER_INDEX_EVENT_NAME, handleDraggedIsOverIndex);
114
114
  }
115
115
  window.removeEventListener(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, handleDrop);
116
- multiScroller.destroy();
117
- multiScroller = undefined;
116
+ // ensuring multiScroller is not already destroyed before destroying
117
+ if(multiScroller) {
118
+ multiScroller.destroy();
119
+ multiScroller = undefined;
120
+ }
118
121
  unobserve();
119
122
  }
120
123