mirror of https://github.com/langgenius/dify.git
feat: add smooth scroll to comment thread
This commit is contained in:
parent
2bce046278
commit
364be48248
|
|
@ -205,8 +205,12 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
|||
const isNewComment = comment.id !== previousCommentIdRef.current
|
||||
const hasNewReply = replies.length > previousReplyCountRef.current
|
||||
|
||||
if (isNewComment || hasNewReply)
|
||||
container.scrollTop = container.scrollHeight
|
||||
if (isNewComment || hasNewReply) {
|
||||
container.scrollTo({
|
||||
top: container.scrollHeight,
|
||||
behavior: 'smooth',
|
||||
})
|
||||
}
|
||||
|
||||
previousCommentIdRef.current = comment.id
|
||||
previousReplyCountRef.current = replies.length
|
||||
|
|
|
|||
Loading…
Reference in New Issue