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 <415800467@qq.com>
pull/7025/head
selicens 2023-10-16 14:33:37 +08:00 committed by GitHub
parent f1bcf2093a
commit b9c65656db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -459,6 +459,9 @@ const List = defineComponent({
fillerInnerRef,
};
},
const delayHideScrollBar = () => {
scrollBarRef.value?.delayHidden();
};
render() {
const {
prefixCls = 'rc-virtual-list',
@ -503,6 +506,7 @@ const List = defineComponent({
style={componentStyle}
ref="componentRef"
onScroll={onFallbackScroll}
onMouseenter={delayHideScrollBar}
>
<Filler
prefixCls={prefixCls}

View File

@ -182,8 +182,8 @@ export default defineComponent({
// ===================== Calculate =====================
getSpinHeight() {
const { height, count } = this.$props;
let baseHeight = (height / count) * 10;
const { height, scrollHeight } = this.$props;
let baseHeight = (height / scrollHeight) * 100;
baseHeight = Math.max(baseHeight, MIN_SIZE);
baseHeight = Math.min(baseHeight, height / 2);
return Math.floor(baseHeight);