We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG 描述 加载更多消息后,定位到加载时的那条消息位置有误差。
预期效果 加载更多消息完成后,消息准确定位到加载时的那条消息
信息
bug视频 https://github.com/Evansy/MallChatWeb/assets/23380976/8deff4f1-e0bb-4494-af7b-3c2c9c2df548
问题初步分析:
MallChatWeb/src/views/Home/components/ChatList/index.vue
Lines 31 to 39 in 29b8c26
当触顶事件onToTop事件内计算得出的newScrollTop都没有问题,但是
virtualListRef.value.scrollToOffset(newScrollTop)
会导致虚拟列表scrollHeight改变,从而使定位出现误差。
以下是验证代码
const onTotop = throttle(async () => { const oldScrollTop = virtualListRef.value.getScrollSize() await chatStore.loadMore() nextTick(() => { const scrollHeight1 = virtualListRef.value.getScrollSize() console.log(scrollHeight1) const newScrollTop = virtualListRef.value.getScrollSize() - oldScrollTop virtualListRef.value.scrollToOffset(newScrollTop) }).then(() => { nextTick(() => { setTimeout(() => { const scrollHeight2 = virtualListRef.value.getScrollSize() console.log(scrollHeight2) }, 1000) }) }) }, 1600)``` 结果发现 scrollHeight1 和 scrollHeight2 并不相等。
The text was updated successfully, but these errors were encountered:
#58 已修复
Sorry, something went wrong.
No branches or pull requests
BUG 描述
加载更多消息后,定位到加载时的那条消息位置有误差。
预期效果
加载更多消息完成后,消息准确定位到加载时的那条消息
信息
bug视频
https://github.com/Evansy/MallChatWeb/assets/23380976/8deff4f1-e0bb-4494-af7b-3c2c9c2df548
问题初步分析:
MallChatWeb/src/views/Home/components/ChatList/index.vue
Lines 31 to 39 in 29b8c26
当触顶事件onToTop事件内计算得出的newScrollTop都没有问题,但是
会导致虚拟列表scrollHeight改变,从而使定位出现误差。
以下是验证代码
The text was updated successfully, but these errors were encountered: