style: update scrollToBottom

pull/56/head
moonrailgun 3 years ago
parent 09b11b17e6
commit 0520e3b6a0

@ -54,11 +54,7 @@ export const VirtualizedMessageList: React.FC<MessageListProps> = React.memo(
if (isAtBottom) { if (isAtBottom) {
setTimeout(() => { setTimeout(() => {
// 这里 Virtuoso 有个动态渲染高度的bug, 因此需要异步再次滚动到底部以确保代码功能work // 这里 Virtuoso 有个动态渲染高度的bug, 因此需要异步再次滚动到底部以确保代码功能work
listRef.current?.scrollToIndex({ listRef.current?.autoscrollToBottom();
index:
PREPEND_OFFSET - numItemsPrepended + props.messages.length - 1,
align: 'end',
});
}, 20); }, 20);
} }

@ -42,7 +42,7 @@ export const UserListItem: React.FC<UserListItemProps> = React.memo((props) => {
#{userInfo.discriminator} #{userInfo.discriminator}
</span> </span>
</div> </div>
<Space>{...actions}</Space> <Space>{actions}</Space>
</Skeleton> </Skeleton>
</div> </div>
); );

Loading…
Cancel
Save