@kdcloudjs/table 1.1.2 → 1.1.3-canary.1

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.
@@ -4091,7 +4091,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
4091
4091
  offsetY: offsetY
4092
4092
  };
4093
4093
  }), rxjs_operators__WEBPACK_IMPORTED_MODULE_29__["distinctUntilChanged"](function (x, y) {
4094
- // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
4094
+ // 如果表格区域被隐藏, 不需要触发组件重渲染
4095
+ if (y.maxRenderHeight === 0 && y.maxRenderWidth === 0) {
4096
+ return true;
4097
+ } // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
4098
+
4099
+
4095
4100
  return Math.abs(x.maxRenderWidth - y.maxRenderWidth) < _utils__WEBPACK_IMPORTED_MODULE_39__["OVERSCAN_SIZE"] / 2 && Math.abs(x.maxRenderHeight - y.maxRenderHeight) < _utils__WEBPACK_IMPORTED_MODULE_39__["OVERSCAN_SIZE"] / 2 && Math.abs(x.offsetY - y.offsetY) < _utils__WEBPACK_IMPORTED_MODULE_39__["OVERSCAN_SIZE"] / 2;
4096
4101
  })).subscribe(function (sizeAndOffset) {
4097
4102
  _this2.setState(sizeAndOffset);
@@ -4184,10 +4189,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
4184
4189
 
4185
4190
  if (size === 0) {
4186
4191
  zeroHeightRowCount += 1;
4192
+ } else {
4193
+ // 渲染出来的行高度为0,说明是display=none情况,行高不存在该种异常情况,不保存当前的高度
4194
+ this.rowHeightManager.updateRow(_rowIndex, offset, size);
4187
4195
  }
4188
4196
 
4189
4197
  maxTrBottom = Math.max(maxTrBottom, offset + size);
4190
- this.rowHeightManager.updateRow(_rowIndex, offset, size);
4191
4198
  } // 当 estimatedRowHeight 过大时,可能出现「渲染行数过少,无法覆盖可视范围」的情况
4192
4199
  // 出现这种情况时,我们判断「下一次渲染能够渲染更多行」是否满足,满足的话就直接调用 forceUpdate
4193
4200
  // zeroHeightRowCount === 0 用于确保当前没有 display=none 的情况