diff --git a/bigbluebutton-html5/imports/ui/components/chat/time-window-list/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/time-window-list/component.jsx index 2e2e54d0006e217595db8e142134c21aa452361b..1cb7e7eeb7991b03014e52d15c9c5591bea558c2 100644 --- a/bigbluebutton-html5/imports/ui/components/chat/time-window-list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/time-window-list/component.jsx @@ -104,8 +104,19 @@ class TimeWindowList extends PureComponent { syncedPercent, lastTimeWindowValuesBuild, scrollPosition: scrollProps, + count } = this.props; + const { userScrolledBack } = this.state; + + if((count > 0 && !userScrolledBack) || userSentMessage){ + const lastItemIndex = timeWindowsValues.length - 1; + + this.setState({ + scrollPosition: lastItemIndex, + }, ()=> this.handleScrollUpdate(lastItemIndex)); + } + const { timeWindowsValues: prevTimeWindowsValues, chatId: prevChatId, @@ -304,10 +315,11 @@ class TimeWindowList extends PureComponent { const { scrollArea, scrollPosition, + userScrolledBack, } = this.state; ChatLogger.debug('TimeWindowList::render', {...this.props}, {...this.state}, new Date()); - const shouldAutoScroll = !!(scrollPosition && timeWindowsValues.length >= scrollPosition); + const shouldAutoScroll = !!(scrollPosition && timeWindowsValues.length >= scrollPosition && !userScrolledBack); return ( [<div