@zhenliang/sheet 0.1.72-beta.3 → 0.1.72-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.
@@ -293,8 +293,11 @@ var Sheet = function Sheet(props) {
293
293
  return null;
294
294
  }, [isEmptyData, emptyRenderer]);
295
295
  var hasHorizontalScrollbar = sheetWrapperRef.current && sheetWrapperRef.current.scrollWidth > sheetWrapperRef.current.clientWidth;
296
- var handleScroll = useCallback(function (event) {
297
- var div = event.target;
296
+ var handleScroll = useCallback(function () {
297
+ if (!sheetWrapperRef.current) {
298
+ return;
299
+ }
300
+ var div = sheetWrapperRef.current;
298
301
 
299
302
  // 当前的滚动位置
300
303
  var scrollLeft = div.scrollLeft;
@@ -310,6 +313,11 @@ var Sheet = function Sheet(props) {
310
313
  setIsScrolledToEnd(false);
311
314
  }
312
315
  }, []);
316
+ useEffect(function () {
317
+ if (sheetWrapperRef.current) {
318
+ handleScroll();
319
+ }
320
+ }, []);
313
321
  return /*#__PURE__*/_jsx(SheetEventContext.Provider, {
314
322
  value: eventBus,
315
323
  children: /*#__PURE__*/_jsxs(_Fragment, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.72-beta.3",
3
+ "version": "0.1.72-beta.4",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",