Skip to content

Commit

Permalink
Merge pull request #873 from sheinsight/fix-table-vertical-scroll-shake
Browse files Browse the repository at this point in the history
fix: 避免Table垂直方向上的滚动条抖动现象
  • Loading branch information
saint3347 authored Dec 16, 2024
2 parents 9201dfd + 6354b1d commit cd88e28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sheinx",
"private": true,
"version": "3.5.5-beta.3",
"version": "3.5.5-beta.4",
"description": "A react library developed with sheinx",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/base/src/virtual-scroll/scroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ const Scroll = (props: scrollProps) => {
top: 0,
} as React.CSSProperties;

const paddingTop = useMemo(() => Math.max(0, Math.floor(scrollHeight - height)), [scrollHeight, height]);
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
const paddingTop = height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
const placeStyle = {
paddingTop,
width: scrollWidth,
Expand Down

0 comments on commit cd88e28

Please sign in to comment.