Comparing version 12.0.1 to 14.0.0
@@ -62,3 +62,8 @@ "use strict"; | ||
var source = registry.getSource(sourceId); | ||
var item = source.beginDrag(monitor, sourceId); | ||
var item = source.beginDrag(monitor, sourceId); // If source.beginDrag returns null, this is an indicator to cancel the drag | ||
if (item == null) { | ||
return undefined; | ||
} | ||
verifyItemIsObject(item); | ||
@@ -65,0 +70,0 @@ registry.pinSource(sourceId); |
@@ -50,3 +50,8 @@ import { invariant } from '@react-dnd/invariant'; | ||
var source = registry.getSource(sourceId); | ||
var item = source.beginDrag(monitor, sourceId); | ||
var item = source.beginDrag(monitor, sourceId); // If source.beginDrag returns null, this is an indicator to cancel the drag | ||
if (item == null) { | ||
return undefined; | ||
} | ||
verifyItemIsObject(item); | ||
@@ -53,0 +58,0 @@ registry.pinSource(sourceId); |
@@ -39,3 +39,3 @@ export declare type Identifier = string | symbol; | ||
/** | ||
* Returns a string or an ES6 symbol identifying the type of the current dragged item. Returns null if no item is being dragged. | ||
* Returns a string or a symbol identifying the type of the current dragged item. Returns null if no item is being dragged. | ||
*/ | ||
@@ -42,0 +42,0 @@ getItemType(): Identifier | null; |
@@ -41,2 +41,6 @@ import { invariant } from '@react-dnd/invariant'; | ||
const item = source.beginDrag(monitor, sourceId); | ||
// If source.beginDrag returns null, this is an indicator to cancel the drag | ||
if (item == null) { | ||
return undefined; | ||
} | ||
verifyItemIsObject(item); | ||
@@ -43,0 +47,0 @@ registry.pinSource(sourceId); |
@@ -39,3 +39,3 @@ export declare type Identifier = string | symbol; | ||
/** | ||
* Returns a string or an ES6 symbol identifying the type of the current dragged item. Returns null if no item is being dragged. | ||
* Returns a string or a symbol identifying the type of the current dragged item. Returns null if no item is being dragged. | ||
*/ | ||
@@ -42,0 +42,0 @@ getItemType(): Identifier | null; |
{ | ||
"name": "dnd-core", | ||
"version": "12.0.1", | ||
"version": "14.0.0", | ||
"description": "Drag and drop sans the GUI", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
174277
4376