shineout 3.9.16-beta.3 → 3.9.16-beta.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.
package/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.16-beta.3'
525
+ version: '3.9.16-beta.4'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12326,7 +12326,7 @@ var handleStyle = function handleStyle(style) {
12326
12326
  };
12327
12327
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12328
12328
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12329
- /* harmony default export */ var version = ('3.9.16-beta.3');
12329
+ /* harmony default export */ var version = ('3.9.16-beta.4');
12330
12330
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12331
12331
 
12332
12332
 
@@ -32302,7 +32302,16 @@ var usePositionStyle = function usePositionStyle(config) {
32302
32302
  scrollLeft = _getScrollPosition.scrollLeft;
32303
32303
  if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
32304
32304
  var _scrollElRef$current2;
32305
- var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
32305
+ var rawVisibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
32306
+ // 当 scrollElRef 是 html/body 时,若内容全为 fixed 定位,其 getBoundingClientRect 高度会变为 0
32307
+ // 此时应使用 window.innerHeight/innerWidth 作为可视区域判断依据
32308
+ var isDocumentRoot = scrollElRef.current === document.documentElement || scrollElRef.current === document.body;
32309
+ var visibleRect = isDocumentRoot && rawVisibleRect.height === 0 ? {
32310
+ top: 0,
32311
+ left: 0,
32312
+ bottom: window.innerHeight,
32313
+ right: window.innerWidth
32314
+ } : rawVisibleRect;
32306
32315
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom + scrollTop || rect.right < visibleRect.left || rect.left > visibleRect.right + scrollLeft) {
32307
32316
  return {
32308
32317
  style: hideStyle
@@ -76021,7 +76030,7 @@ var upload_interface = __webpack_require__(8821);
76021
76030
 
76022
76031
 
76023
76032
  /* harmony default export */ var src_0 = ({
76024
- version: '3.9.16-beta.3'
76033
+ version: '3.9.16-beta.4'
76025
76034
  });
76026
76035
  }();
76027
76036
  /******/ return __webpack_exports__;