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