Skip to content

Commit 6150212

Browse files
authored
Fix bug where captions keep scrolling to the bottom when new captions are received (#3353)
* scrolling bug * Change files * Duplicate change files for beta release
1 parent a58e283 commit 6150212

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fixed bug where captions keep scrolling to the bottom when new captions are received ",
4+
"packageName": "@azure/communication-react",
5+
"email": "carolinecao@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fixed bug where captions keep scrolling to the bottom when new captions are received ",
4+
"packageName": "@azure/communication-react",
5+
"email": "carolinecao@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/src/components/CaptionsBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const _CaptionsBanner = (props: _CaptionsBannerProps): JSX.Element => {
8787
return () => {
8888
captionsScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);
8989
};
90-
}, [handleScrollToTheBottom]);
90+
}, [handleScrollToTheBottom, isCaptionsOn]);
9191

9292
useEffect(() => {
9393
// only auto scroll to bottom is already is at bottom of scroll before new caption comes in

0 commit comments

Comments
 (0)