orc-shared 5.10.2-dev.5 → 5.10.2-dev.6
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.
|
@@ -37,21 +37,16 @@ var withScrollBox = function withScrollBox(WrappedComp) {
|
|
|
37
37
|
var onScroll = _ref.onScroll,
|
|
38
38
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
39
39
|
var classes = useStyles();
|
|
40
|
-
var mergeRef = function mergeRef(node, measureRef) {
|
|
41
|
-
measureRef(node);
|
|
42
|
-
if (externalRef) externalRef.current = node;
|
|
43
|
-
};
|
|
44
40
|
return /*#__PURE__*/_react.default.createElement(_reactMeasure.default, {
|
|
45
|
-
bounds: true
|
|
41
|
+
bounds: true,
|
|
42
|
+
innerRef: externalRef
|
|
46
43
|
}, function (_ref2) {
|
|
47
44
|
var measureRef = _ref2.measureRef,
|
|
48
45
|
contentRect = _ref2.contentRect;
|
|
49
46
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
50
47
|
className: classes.scrollbox,
|
|
51
48
|
onScroll: onScroll,
|
|
52
|
-
ref:
|
|
53
|
-
return mergeRef(node, measureRef);
|
|
54
|
-
}
|
|
49
|
+
ref: measureRef
|
|
55
50
|
}, /*#__PURE__*/_react.default.createElement(WrappedComp, _extends({}, otherProps, {
|
|
56
51
|
height: (0, _utils.safeGet)(contentRect, "bounds", "height"),
|
|
57
52
|
width: (0, _utils.safeGet)(contentRect, "bounds", "width")
|
package/package.json
CHANGED
|
@@ -15,16 +15,10 @@ const withScrollBox = WrappedComp =>
|
|
|
15
15
|
React.forwardRef(({ onScroll, ...otherProps }, externalRef) => {
|
|
16
16
|
const classes = useStyles();
|
|
17
17
|
|
|
18
|
-
const mergeRef = (node, measureRef) => {
|
|
19
|
-
measureRef(node);
|
|
20
|
-
|
|
21
|
-
if (externalRef) externalRef.current = node;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
18
|
return (
|
|
25
|
-
<Measure bounds>
|
|
19
|
+
<Measure bounds innerRef={externalRef}>
|
|
26
20
|
{({ measureRef, contentRect }) => (
|
|
27
|
-
<div className={classes.scrollbox} onScroll={onScroll} ref={
|
|
21
|
+
<div className={classes.scrollbox} onScroll={onScroll} ref={measureRef}>
|
|
28
22
|
<WrappedComp
|
|
29
23
|
{...otherProps}
|
|
30
24
|
height={safeGet(contentRect, "bounds", "height")}
|