Scroll with updated height
This commit is contained in:
parent
e6ace54adb
commit
fa03df0f9b
|
@ -73,9 +73,10 @@ export function GroupChat(props: {
|
|||
}, [scrollToMessageRef])
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSubmitting)
|
||||
scrollToBottomRef?.scrollTo({ top: scrollToBottomRef?.scrollHeight || 0 })
|
||||
}, [scrollToBottomRef, isSubmitting])
|
||||
if (scrollToBottomRef)
|
||||
scrollToBottomRef.scrollTo({ top: scrollToBottomRef.scrollHeight || 0 })
|
||||
// Must also listen to groupedMessages as they update the height of the messaging window
|
||||
}, [scrollToBottomRef, groupedMessages])
|
||||
|
||||
useEffect(() => {
|
||||
const elementInUrl = router.asPath.split('#')[1]
|
||||
|
|
Loading…
Reference in New Issue
Block a user