wait to scroll to linked comments until readyToDisplay=true
This commit is contained in:
parent
6d4a92ad27
commit
480d8a8786
1 changed files with 2 additions and 2 deletions
|
@ -85,11 +85,11 @@ function CommentList(props: Props) {
|
|||
}, [fetchReacts, uri, totalComments, activeChannel, fetchingChannels]);
|
||||
|
||||
useEffect(() => {
|
||||
if (linkedCommentId && commentRef && commentRef.current) {
|
||||
if (readyToDisplayComments && linkedCommentId && commentRef && commentRef.current) {
|
||||
commentRef.current.scrollIntoView({ block: 'start' });
|
||||
window.scrollBy(0, -100);
|
||||
}
|
||||
}, [linkedCommentId]);
|
||||
}, [readyToDisplayComments, linkedCommentId]);
|
||||
|
||||
useEffect(() => {
|
||||
function handleCommentScroll(e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue