Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Cell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,16 @@ function Cell<RecordType>(props: CellProps<RecordType>) {

const [absScroll, scrollWidth] = scrollInfo;

const showStartShadow = isFixStart && fixedStartShadow && absScroll > fixStart;
const showEndShadow = isFixEnd && fixedEndShadow && scrollWidth - absScroll > fixEnd;
const showStartShadow =
(isFixStart && fixedStartShadow && absScroll) -
// For precision, we not show shadow by default which has better user experience.
(fixStart as number) >=
1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈,安卓滚动有0.几的误差

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认小于 1 的就不展示了,这样也就是少一点距离出现阴影。比永远有阴影舒服,哈哈哈~

const showEndShadow =
(isFixEnd && fixedEndShadow && scrollWidth - absScroll) -
// Same as above
(fixEnd as number) >=
1;

return [showStartShadow, showEndShadow];
});
Expand Down