Skip to content

Commit b9c6565

Browse files
fix(select): list scrollbar height and timing (#6987) (#7001)
* fix: select scrollbar height * fix: mousemove appear scrollbar * Update List.tsx * Update List.tsx --------- Co-authored-by: undefined <undefined> Co-authored-by: tangjinzhou <[email protected]>
1 parent f1bcf20 commit b9c6565

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: components/vc-virtual-list/List.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ const List = defineComponent({
459459
fillerInnerRef,
460460
};
461461
},
462+
const delayHideScrollBar = () => {
463+
scrollBarRef.value?.delayHidden();
464+
};
462465
render() {
463466
const {
464467
prefixCls = 'rc-virtual-list',
@@ -503,6 +506,7 @@ const List = defineComponent({
503506
style={componentStyle}
504507
ref="componentRef"
505508
onScroll={onFallbackScroll}
509+
onMouseenter={delayHideScrollBar}
506510
>
507511
<Filler
508512
prefixCls={prefixCls}

Diff for: components/vc-virtual-list/ScrollBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export default defineComponent({
182182

183183
// ===================== Calculate =====================
184184
getSpinHeight() {
185-
const { height, count } = this.$props;
186-
let baseHeight = (height / count) * 10;
185+
const { height, scrollHeight } = this.$props;
186+
let baseHeight = (height / scrollHeight) * 100;
187187
baseHeight = Math.max(baseHeight, MIN_SIZE);
188188
baseHeight = Math.min(baseHeight, height / 2);
189189
return Math.floor(baseHeight);

0 commit comments

Comments
 (0)