@dnd-kit/dom 0.0.7 → 0.0.8-beta-20250202033300

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.js CHANGED
@@ -1229,24 +1229,27 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1229
1229
  }
1230
1230
  }
1231
1231
  const ownerDocument = getDocument(event.target);
1232
- const unbindListeners = this.listeners.bind(ownerDocument, [
1233
- {
1234
- type: "pointermove",
1235
- listener: (event2) => this.handlePointerMove(event2, source, options)
1236
- },
1237
- {
1238
- type: "pointerup",
1239
- listener: this.handlePointerUp,
1240
- options: {
1241
- capture: true
1232
+ const unbindListeners = this.listeners.bind(
1233
+ ownerDocument.defaultView,
1234
+ [
1235
+ {
1236
+ type: "pointermove",
1237
+ listener: (event2) => this.handlePointerMove(event2, source, options)
1238
+ },
1239
+ {
1240
+ type: "pointerup",
1241
+ listener: this.handlePointerUp,
1242
+ options: {
1243
+ capture: true
1244
+ }
1245
+ },
1246
+ {
1247
+ // Cancel activation if there is a competing Drag and Drop interaction
1248
+ type: "dragstart",
1249
+ listener: isNativeDraggable ? this.handleCancel : preventDefault
1242
1250
  }
1243
- },
1244
- {
1245
- // Cancel activation if there is a competing Drag and Drop interaction
1246
- type: "dragstart",
1247
- listener: isNativeDraggable ? this.handleCancel : preventDefault
1248
- }
1249
- ]);
1251
+ ]
1252
+ );
1250
1253
  const cleanup = () => {
1251
1254
  var _a3;
1252
1255
  setTimeout(unbindListeners);
@@ -1343,6 +1346,10 @@ var _PointerSensor = class _PointerSensor extends Sensor {
1343
1346
  {
1344
1347
  type: "keydown",
1345
1348
  listener: this.handleKeyDown
1349
+ },
1350
+ {
1351
+ type: "lostpointercapture",
1352
+ listener: this.handlePointerUp
1346
1353
  }
1347
1354
  ]);
1348
1355
  ownerDocument.body.setPointerCapture(event.pointerId);