unsortable 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { DragDropManager, Draggable, Droppable } from '@dnd-kit/dom'
2
2
  import { getNearestParentElementFromMap, hasValue, move, toArrayAccessors, toItemAccessor } from './utils'
3
- // import { closestCenter, pointerIntersection, directionBiased } from '@dnd-kit/collision'
4
3
 
5
4
  /**
6
5
  * @typedef {Object} UnsortableOptions
@@ -51,6 +50,7 @@ export class Unsortable {
51
50
  const droppable = e.operation.source.data.droppable
52
51
  console.debug('Unsortable: disabling own droppable', droppable, lastDroppable)
53
52
  if (lastDroppable && droppable !== lastDroppable) this._restoreLastDroppable()
53
+ else if (lastDroppable === droppable) return
54
54
  lastDroppableOriginalState = droppable.disabled
55
55
  droppable.disabled = true
56
56
  lastDroppable = droppable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unsortable",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Headless drag-and-drop library for nested sorting using state instead of DOM mutations.",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",