@os-design/drag-sort
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -98,12 +98,8 @@ "use strict"; | ||
}); | ||
var renderChildren = (0, _react.useCallback)(function () { | ||
if (typeof children !== 'function') return children; | ||
return children({ | ||
ref: ref, | ||
innerRef: innerRef | ||
}); | ||
}, [children]); | ||
return /*#__PURE__*/_react["default"].createElement(_useDroppable.DroppableContext.Provider, { | ||
value: droppableContext | ||
}, renderChildren()); | ||
}, children({ | ||
ref: ref, | ||
innerRef: innerRef | ||
})); | ||
}; | ||
@@ -110,0 +106,0 @@ |
@@ -56,3 +56,3 @@ "use strict"; | ||
var current = list.ref.current; | ||
if (!current) return true; | ||
if (!current) return false; | ||
var rect = current.getBoundingClientRect(); | ||
@@ -59,0 +59,0 @@ return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; |
@@ -71,12 +71,8 @@ import React, { useCallback, useEffect, useMemo, useRef } from 'react'; | ||
}); | ||
const renderChildren = useCallback(() => { | ||
if (typeof children !== 'function') return children; | ||
return children({ | ||
ref, | ||
innerRef | ||
}); | ||
}, [children]); | ||
return /*#__PURE__*/React.createElement(DroppableContext.Provider, { | ||
value: droppableContext | ||
}, renderChildren()); | ||
}, children({ | ||
ref, | ||
innerRef | ||
})); | ||
}; | ||
@@ -83,0 +79,0 @@ |
@@ -37,3 +37,3 @@ /** | ||
} = list.ref; | ||
if (!current) return true; | ||
if (!current) return false; | ||
const rect = current.getBoundingClientRect(); | ||
@@ -40,0 +40,0 @@ return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; |
@@ -11,3 +11,3 @@ import React, { RefObject } from 'react'; | ||
horizontal?: boolean; | ||
children: React.ReactNode | ((props: DroppableChildrenProps) => React.ReactNode); | ||
children: (props: DroppableChildrenProps) => React.ReactNode; | ||
} | ||
@@ -14,0 +14,0 @@ declare const Droppable: React.FC<DroppableProps>; |
{ | ||
"name": "@os-design/drag-sort", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"license": "UNLICENSED", | ||
@@ -48,3 +48,3 @@ "repository": "git@gitlab.com:os-team/libs/os-design.git", | ||
}, | ||
"gitHead": "b1ea7d447a394d8ea1ea077d6e91a7c151b8af50" | ||
"gitHead": "64269f60ac23373277a70d247145ff934f00948c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
343754
3074