Skip to content

Commit af15730

Browse files
Revert a11y dropdwon group announcement (#5856)
1 parent a7dbc63 commit af15730

3 files changed

Lines changed: 3 additions & 41 deletions

File tree

change-beta/@azure-communication-react-4b170639-a671-4920-b5d6-0f5348f02b5f.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

change-beta/@azure-communication-react-dddcb5df-0075-426b-8012-314e9c29ae97.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,6 @@ const getDropDownList = (list: Array<VideoDeviceInfo | AudioDeviceInfo>): IDropd
5050
return dropdownList;
5151
};
5252

53-
// This helper function is used to prepend a header item to the dropdown list.
54-
// Allows Dropdowns to have a name for the list of options when first being actioned (a11y requirement).
55-
const prependHeaderDropdownItem = (list: IDropdownOption[], headerTitle: string): IDropdownOption[] => {
56-
const headerItem: IDropdownOption = {
57-
key: headerTitle,
58-
text: headerTitle,
59-
itemType: 2,
60-
hidden: true
61-
};
62-
return [headerItem, ...list];
63-
};
64-
6553
const getOptionIcon = (type: iconType): JSX.Element | undefined => {
6654
if (type === 'Camera') {
6755
return <CallCompositeIcon iconName="LocalDeviceSettingsCamera" className={optionIconStyles} />;
@@ -163,11 +151,7 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
163151
data-ui-id="call-composite-local-camera-settings"
164152
aria-labelledby={cameraLabelId}
165153
placeholder={hasCameras ? defaultPlaceHolder : noCameraLabel}
166-
options={
167-
cameraPermissionGranted
168-
? prependHeaderDropdownItem(getDropDownList(props.cameras), cameraLabel)
169-
: [{ key: 'deniedOrUnknown', text: '' }]
170-
}
154+
options={cameraPermissionGranted ? getDropDownList(props.cameras) : [{ key: 'deniedOrUnknown', text: '' }]}
171155
styles={dropDownStyles(theme)}
172156
disabled={!cameraPermissionGranted || !hasCameras}
173157
errorMessage={
@@ -209,11 +193,7 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
209193
? undefined
210194
: locale.strings.call.microphonePermissionDenied
211195
}
212-
options={
213-
micPermissionGranted
214-
? prependHeaderDropdownItem(getDropDownList(props.microphones), soundLabel)
215-
: [{ key: 'deniedOrUnknown', text: '' }]
216-
}
196+
options={micPermissionGranted ? getDropDownList(props.microphones) : [{ key: 'deniedOrUnknown', text: '' }]}
217197
defaultSelectedKey={
218198
micPermissionGranted
219199
? props.selectedMicrophone
@@ -245,7 +225,7 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
245225
placeholder={hasSpeakers ? defaultPlaceHolder : noSpeakersLabel}
246226
styles={dropDownStyles(theme)}
247227
disabled={props.speakers.length === 0}
248-
options={prependHeaderDropdownItem(getDropDownList(props.speakers), soundLabel)}
228+
options={getDropDownList(props.speakers)}
249229
defaultSelectedKey={props.selectedSpeaker ? props.selectedSpeaker.id : defaultDeviceId(props.speakers)}
250230
onChange={(
251231
event: React.FormEvent<HTMLDivElement>,

0 commit comments

Comments
 (0)