shineout 3.6.1-beta.5 → 3.6.1-beta.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.
package/cjs/index.js CHANGED
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
514
514
  // 此文件由脚本自动生成,请勿直接修改。
515
515
  // This file was generated automatically by a script. Please do not modify it directly.
516
516
  var _default = exports.default = {
517
- version: '3.6.1-beta.5'
517
+ version: '3.6.1-beta.6'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12139,7 +12139,7 @@ var handleStyle = function handleStyle(style) {
12139
12139
  };
12140
12140
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12141
12141
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12142
- /* harmony default export */ var version = ('3.6.1-beta.5');
12142
+ /* harmony default export */ var version = ('3.6.1-beta.6');
12143
12143
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12144
12144
 
12145
12145
 
@@ -29945,6 +29945,12 @@ function getParent(el, target) {
29945
29945
  }
29946
29946
  return null;
29947
29947
  }
29948
+ function isScrollable(el) {
29949
+ var style = window.getComputedStyle(el);
29950
+ var overflowX = style.overflowX;
29951
+ var overflowY = style.overflowY;
29952
+ return (overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll') && (el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth);
29953
+ }
29948
29954
  function getClosestScrollContainer(element) {
29949
29955
  if (!element) {
29950
29956
  return null;
@@ -33903,6 +33909,7 @@ var card_group_jssStyle = {
33903
33909
  ;// CONCATENATED MODULE: ../hooks/src/common/use-in-view/use-in-view.ts
33904
33910
 
33905
33911
 
33912
+
33906
33913
  var useInView = function useInView() {
33907
33914
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33908
33915
  var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
@@ -33935,7 +33942,7 @@ var useInView = function useInView() {
33935
33942
  }
33936
33943
  }
33937
33944
  }, {
33938
- root: options.root || null,
33945
+ root: options.root && isScrollable(options.root) ? options.root : null,
33939
33946
  rootMargin: options.rootMargin || '0px',
33940
33947
  threshold: options.threshold || 0
33941
33948
  });
@@ -69678,7 +69685,7 @@ var upload_interface = __webpack_require__(8821);
69678
69685
 
69679
69686
 
69680
69687
  /* harmony default export */ var src_0 = ({
69681
- version: '3.6.1-beta.5'
69688
+ version: '3.6.1-beta.6'
69682
69689
  });
69683
69690
  }();
69684
69691
  /******/ return __webpack_exports__;