Skip to content

Commit

Permalink
下一页时滚动到评论开始
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink authored and fengxxc committed Feb 9, 2023
1 parent 987253b commit 0000ba8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/component/CommentList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function CommentList(props: CommentListPropTypes) {
setListLoading(true);
setCommentList([]);
setPage(value);
document.getElementById("scroll")?.scrollIntoView({ behavior: "smooth" });
};

React.useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions src/features/Comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function CommentComponent(props: CommentPropTypes) {

<CommentInput resourceId={id} setCommentList={setCommentList} />
<br />
<div id="scroll" />
<CommentList id={id} loading={loading} commentList={commentList} setCommentList={setCommentList} />
</div>
);
Expand Down

0 comments on commit 0000ba8

Please sign in to comment.