@dnd-kit/dom 0.2.0 → 0.2.1
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/index.cjs +9 -4
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/index.js +9 -4
- package/index.js.map +1 -1
- package/package.json +5 -5
package/index.cjs
CHANGED
|
@@ -1635,8 +1635,13 @@ var defaults2 = Object.freeze({
|
|
|
1635
1635
|
];
|
|
1636
1636
|
},
|
|
1637
1637
|
preventActivation(event, source) {
|
|
1638
|
+
var _a4;
|
|
1638
1639
|
const { target } = event;
|
|
1639
|
-
|
|
1640
|
+
if (target === source.element) return false;
|
|
1641
|
+
if (target === source.handle) return false;
|
|
1642
|
+
if (!utilities.isElement(target)) return false;
|
|
1643
|
+
if ((_a4 = source.handle) == null ? void 0 : _a4.contains(target)) return false;
|
|
1644
|
+
return utilities.isInteractiveElement(target);
|
|
1640
1645
|
}
|
|
1641
1646
|
});
|
|
1642
1647
|
var _cleanup;
|
|
@@ -1695,12 +1700,12 @@ var _PointerSensor = class _PointerSensor extends abstract.Sensor {
|
|
|
1695
1700
|
});
|
|
1696
1701
|
return unbind;
|
|
1697
1702
|
}
|
|
1698
|
-
handlePointerDown(event, source, options
|
|
1699
|
-
var _a4;
|
|
1703
|
+
handlePointerDown(event, source, options) {
|
|
1700
1704
|
if (this.disabled || !event.isPrimary || event.button !== 0 || !utilities.isElement(event.target) || source.disabled || isCapturedBySensor(event) || !this.manager.dragOperation.status.idle) {
|
|
1701
1705
|
return;
|
|
1702
1706
|
}
|
|
1703
|
-
|
|
1707
|
+
const { preventActivation = defaults2.preventActivation } = options != null ? options : {};
|
|
1708
|
+
if (preventActivation == null ? void 0 : preventActivation(event, source)) {
|
|
1704
1709
|
return;
|
|
1705
1710
|
}
|
|
1706
1711
|
const { target } = event;
|