@helpdice/draggable 0.0.3 → 0.0.4

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.
@@ -36,7 +36,7 @@ export type DefaultProps = {
36
36
  direction?: Direction;
37
37
  renderClone?: DraggableChildrenFn | null;
38
38
  ignoreContainerClipping?: boolean;
39
- getContainerForClone: () => HTMLElement;
39
+ getContainerForClone?: () => HTMLElement;
40
40
  };
41
41
  export type DispatchProps = {
42
42
  updateViewportMaxScroll: typeof updateViewportMaxScroll;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/draggable",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Beautiful and accessible drag and drop for lists with React",
5
5
  "author": "Helpdice",
6
6
  "type": "module",
@@ -72,7 +72,7 @@ export type DefaultProps = {
72
72
  direction?: Direction,
73
73
  renderClone?: DraggableChildrenFn | null,
74
74
  ignoreContainerClipping?: boolean,
75
- getContainerForClone: () => HTMLElement,
75
+ getContainerForClone?: () => HTMLElement,
76
76
  };
77
77
 
78
78
  // Exact
@@ -155,6 +155,8 @@ export default function Droppable(props: Props) {
155
155
  </PrivateDraggable>
156
156
  );
157
157
 
158
+ if (!getContainerForClone) return null;
159
+
158
160
  return ReactDOM.createPortal(node, getContainerForClone());
159
161
  }
160
162