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

View File

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