Skip to content

Commit c94e224

Browse files
pagour98parv_gour
andauthored
fix(fcc): accessibility issue fix for disabled audio and video button. (#848)
Co-authored-by: parv_gour <parv_gour@PAGOUR-M-D8B2>
1 parent 7fbd3a1 commit c94e224

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/components/WebexMeetingControl/WebexMeetingControl.jsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import {MeetingControlState} from '@webex/component-adapter-interfaces';
4-
4+
import {MUTE_AUDIO_CONTROL, MUTE_VIDEO_CONTROL} from '../../adapters/MeetingsJSONAdapter';
55
import webexComponentClasses from '../helpers';
66
import {useMeetingControl} from '../hooks';
77
import Button from '../generic/Button/Button';
88
import Icon from '../generic/Icon/Icon';
99
import Dropdown from '../inputs/Dropdown/Dropdown';
10+
import {NO_MIC_ARIA_LABEL_TEXT, NO_CAMERA_ARIA_LABEL_TEXT} from '../../constants';
1011

1112
const controlTypeToButtonType = {
1213
JOIN: 'join',
@@ -39,6 +40,12 @@ function renderButton(sc, action, display, style, showText, asItem, autoFocus, t
3940
} = display;
4041
const isDisabled = display.state === MeetingControlState.DISABLED;
4142
const isActive = display.state === MeetingControlState.ACTIVE;
43+
let ariaLabelText = text;
44+
45+
const NO_MIC_CAMERA_ARIA_LABEL = {
46+
NO_MIC_ARIA_LABEL: 'No microphone',
47+
NO_CAMERA_ARIA_LABEL: 'No camera',
48+
};
4249

4350
let output;
4451

@@ -57,14 +64,21 @@ function renderButton(sc, action, display, style, showText, asItem, autoFocus, t
5764
</Button>
5865
);
5966
} else {
67+
if (display.ID === MUTE_AUDIO_CONTROL && display.state === MeetingControlState.DISABLED
68+
&& text === NO_MIC_CAMERA_ARIA_LABEL.NO_MIC_ARIA_LABEL) {
69+
ariaLabelText = NO_MIC_ARIA_LABEL_TEXT;
70+
} else if (display.ID === MUTE_VIDEO_CONTROL && display.state === MeetingControlState.DISABLED
71+
&& text === NO_MIC_CAMERA_ARIA_LABEL.NO_CAMERA_ARIA_LABEL) {
72+
ariaLabelText = NO_CAMERA_ARIA_LABEL_TEXT;
73+
}
6074
output = (
6175
<Button
6276
className={sc('control-button')}
6377
type={controlTypeToButtonType[type] || 'default'}
6478
size={48}
6579
isDisabled={isDisabled}
6680
onClick={action}
67-
ariaLabel={text || tooltip}
81+
ariaLabel={ariaLabelText || tooltip}
6882
pressed={isActive && type === 'TOGGLE'}
6983
tooltip={tooltip}
7084
autoFocus={autoFocus}

src/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Note, this string must match the one from src/styles/variables.scss
22
// eslint-disable-next-line import/prefer-default-export
33
export const WEBEX_COMPONENTS_CLASS_PREFIX = 'wxc';
4+
export const NO_MIC_ARIA_LABEL_TEXT = 'No Microphone, disabled';
5+
export const NO_CAMERA_ARIA_LABEL_TEXT = 'No Camera, disabled';

0 commit comments

Comments
 (0)