Skip to content

Commit 63a1c6b

Browse files
authored
fix(v8 Dropdown): VoiceOver on iOS safari can reach Dropdown options (#34973)
1 parent ed4b526 commit 63a1c6b

2 files changed

Lines changed: 12 additions & 2 deletions

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": "fix: VoiceOver on iOS safari can reach Dropdown options",
4+
"packageName": "@fluentui/react",
5+
"email": "sarah.higley@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react/src/components/Dropdown/Dropdown.base.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ class DropdownInternal extends React.Component<IDropdownInternalProps, IDropdown
324324
onRenderLabel = this._onRenderLabel,
325325
onRenderItem = this._onRenderItem,
326326
hoisted: { selectedIndices },
327+
responsiveMode,
327328
} = props;
328329
const { isOpen, calloutRenderEdge, hasFocus } = this.state;
329330
// eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -339,6 +340,8 @@ class DropdownInternal extends React.Component<IDropdownInternalProps, IDropdown
339340

340341
const disabled = this._isDisabled();
341342

343+
const isSmall = responsiveMode! <= ResponsiveMode.medium;
344+
342345
const errorMessageId = id + '-errorMessage';
343346

344347
this._classNames = getClassNames(propStyles, {
@@ -361,7 +364,7 @@ class DropdownInternal extends React.Component<IDropdownInternalProps, IDropdown
361364
<div
362365
className={this._classNames.root}
363366
ref={this.props.hoisted.rootRef}
364-
aria-owns={isOpen ? this._listId : undefined}
367+
aria-owns={isOpen && !isSmall ? this._listId : undefined}
365368
>
366369
{onRenderLabel(this.props, this._onRenderLabel)}
367370
<div
@@ -379,7 +382,7 @@ class DropdownInternal extends React.Component<IDropdownInternalProps, IDropdown
379382
aria-required={required}
380383
aria-disabled={disabled}
381384
aria-invalid={hasErrorMessage}
382-
aria-controls={isOpen ? this._listId : undefined}
385+
aria-controls={isOpen && !isSmall ? this._listId : undefined}
383386
{...divProps}
384387
className={this._classNames.dropdown}
385388
onBlur={this._onDropdownBlur}

0 commit comments

Comments
 (0)