Skip to content

Commit 0fef847

Browse files
Fix bug where Captions Banner Aria label is showing 'Live Captions' when RTT is on (#5997)
* fix aria label * changelog --------- Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com>
1 parent a8ed178 commit 0fef847

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Captions",
5+
"comment": "Fixed bug when RTT is on, captions banner aria label is still showing Live Captions",
6+
"packageName": "@azure/communication-react",
7+
"email": "96077406+carocao-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/common/CallingCaptionsBanner.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ export const CallingCaptionsBanner = (props: {
9999

100100
const desktopViewBannerWidth = windowWidth > 620 ? '35rem' : '80%';
101101

102+
const containerAriaLabel = // 3 cases, captions only, RTT only, captions + RTT we adjust the aria-label accordingly
103+
captionsBannerProps.isCaptionsOn && !(props.isRealTimeTextOn || captionsBannerProps.isRealTimeTextOn)
104+
? strings.liveCaptionsLabel
105+
: !captionsBannerProps.isCaptionsOn && (props.isRealTimeTextOn || captionsBannerProps.isRealTimeTextOn)
106+
? strings.realTimeTextLabel
107+
: strings.captionsAndRealTimeTextContainerTitle;
108+
102109
return (
103110
<>
104111
{isCaptionsSettingsOpen && (
@@ -109,7 +116,7 @@ export const CallingCaptionsBanner = (props: {
109116
/>
110117
)}
111118
{
112-
<div className={containerClassName} role="region" aria-label={strings.liveCaptionsLabel}>
119+
<div className={containerClassName} role="region" aria-label={containerAriaLabel}>
113120
<Stack horizontalAlign="center">
114121
<Stack.Item style={{ width: props.isMobile ? mobileViewBannerWidth : desktopViewBannerWidth }}>
115122
<CaptionsBanner

0 commit comments

Comments
 (0)