diff --git a/src/pages/HighQualityOperation/Detail.tsx b/src/pages/HighQualityOperation/Detail.tsx index 1724151..c2b5842 100644 --- a/src/pages/HighQualityOperation/Detail.tsx +++ b/src/pages/HighQualityOperation/Detail.tsx @@ -77,6 +77,7 @@ const Detail: React.FC = (props) => { }) } const getCommentList = (reId: string, count: number) => { + if (listRef.current) { listRef.current.scrollTo({ top: 0 }); } const array = [...new Array(count)].map(() => ({ loading: true, createrName: "", context: "", createTime: "" })); setCommentList(array.concat(commentRef.current)); setLoading(true); @@ -118,7 +119,6 @@ const Detail: React.FC = (props) => { } else if (data.length > 2) { count = data.length + 2; } - if (listRef.current) { listRef.current.scrollTo({ top: 0 }); } getCommentList(reId, count); } }