Skip to content

Commit

Permalink
Dropdown: Removing aria-required from multiselect scenarios since it'…
Browse files Browse the repository at this point in the history
…s not allowed for role='button' (#14369)

#### Pull request checklist

- [x] Addresses an existing issue: Fixes #14355
- [x] Include a change request file using `$ yarn change`

#### Description of changes

We were placing `aria-required` on `Dropdowns`, but this clashed with the `role='button'` we were placing on multiselect `Dropdowns` and creating accessibility warnings. We're fixing this issue by setting `aria-required` only for single select `Dropdowns`.

#### Focus areas to test

(optional)
  • Loading branch information
khmakoto authored Aug 5, 2020
1 parent 6794605 commit ff937a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "Dropdown: Removing aria-required from multiselect scenarios since it's not allowed for role='button'.",
"packageName": "office-ui-fabric-react",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-08-05T22:01:13.918Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export class DropdownBase extends React.Component<IDropdownInternalProps, IDropd
{
role: 'listbox',
childRole: 'option',
ariaRequired: required,
ariaSetSize: this._sizePosCache.optionSetSize,
ariaPosInSet: this._sizePosCache.positionInSet(selectedIndices[0]),
ariaSelected: selectedIndices[0] === undefined ? undefined : true,
Expand Down Expand Up @@ -313,7 +314,7 @@ export class DropdownBase extends React.Component<IDropdownInternalProps, IDropd
hasErrorMessage ? this._id + '-errorMessage' : undefined,
)}
aria-activedescendant={ariaActiveDescendant}
aria-required={required}
aria-required={ariaAttrs.ariaRequired}
aria-disabled={disabled}
aria-owns={isOpen ? this._listId : undefined}
{...divProps}
Expand Down

0 comments on commit ff937a4

Please sign in to comment.