Skip to content

Commit

Permalink
fix: Fix the problem that the BubbleList component cannot trigger scr…
Browse files Browse the repository at this point in the history
…olling (#101)

Co-authored-by: lihuifeng <lihuifeng@f-cloud.com.cn>
  • Loading branch information
enootttt and lihuifeng authored Feb 28, 2025
1 parent cf2f9bb commit 5d382f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bubble/BubbleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useDisplayData from './hooks/useDisplayData';
import useListData from './hooks/useListData';
import type { BubbleListProps } from './interface';
import useStyle from './style';
import { computed, type HTMLAttributes, mergeProps, onWatcherCleanup, ref, unref, useAttrs, watch, watchEffect } from 'vue';
import { computed, type HTMLAttributes, mergeProps, onWatcherCleanup, ref, unref, useAttrs, watch, watchEffect, nextTick } from 'vue';
import useState from '../_util/hooks/use-state';
import BubbleContextProvider from './context';
Expand Down Expand Up @@ -85,10 +85,12 @@ const onInternalScroll = (e: Event) => {
watch(updateCount, () => {
if (autoScroll && unref(listRef) && unref(scrollReachEnd)) {
unref(listRef).scrollTo({
nextTick(() => {
unref(listRef).scrollTo({
top: unref(listRef).scrollHeight,
});
}
})
}
});
// Always scroll to bottom when data change
Expand Down

0 comments on commit 5d382f8

Please sign in to comment.