Skip to content

Commit 93fd3dc

Browse files
Whbbit1999kagol
authored andcommitted
fix: 修复DatePickerPro打开日历下拉面板时闪现两个滚动条的问题
1 parent 70d3cdc commit 93fd3dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/devui-vue/devui/virtual-list/src/virtual-list.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,16 @@ export default defineComponent({
235235
syncScrollTop(newTop);
236236
};
237237

238+
const oldScrollTop = ref(0);
238239
const onComponentScroll = (e: UIEvent) => {
239240
const { scrollTop: newScrollTop } = e.currentTarget as Element;
240241
if (Math.abs(newScrollTop - state.scrollTop) >= 1) {
241242
syncScrollTop(newScrollTop);
242243
}
243-
244-
if (Math.abs(newScrollTop - state.scrollTop) !== 0) {
244+
if (oldScrollTop.value) {
245245
barRef?.value?.onShowBar?.();
246246
}
247+
oldScrollTop.value = newScrollTop;
247248
ctx.emit('scroll', e);
248249
};
249250

0 commit comments

Comments
 (0)