Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/changes/scriby-dropdown-ax-fixes_2017-04-26-10-27.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Dropdown: Fix an issue with screenreaders not reading menu items.",
"type": "patch"
}
],
"email": "chscribn@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
aria-describedby={ id + '-option' }
aria-activedescendant={ isOpen && selectedIndex >= 0 ? (this._id + '-list' + selectedIndex) : null }
aria-disabled={ disabled }
aria-owns={ id + '-list' }
>
<span
id={ id + '-option' }
Expand Down Expand Up @@ -253,6 +254,7 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
className={ css('ms-Dropdown-items', styles.items) }
aria-labelledby={ id + '-label' }
onKeyDown={ this._onZoneKeyDown }
role='listbox'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this, is a combobox a listbox?

Copy link
Copy Markdown
Contributor Author

@scriby scriby Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.

The combobox is the main control that indicates what is selected, and can pop open a list of choices. Typically a combobox has editable text, but it's not required. Note that the dropdown still uses role="combobox" (I didn't change that).

The list of choices that the combobox shows is a listbox (with options).

This is the same structure used in the example I linked.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh there was a link.. :) Makes sense then, thanks for the change!

>
{ this.props.options.map((item, index) => onRenderItem({ ...item, index }, this._onRenderItem)) }
</FocusZone>
Expand Down Expand Up @@ -311,9 +313,9 @@ export class Dropdown extends BaseComponent<IDropdownInternalProps, IDropdownSta
}
) }
onClick={ () => this._onItemClick(item.index) }
role='menu'
role='option'
aria-selected={ this.state.selectedIndex === item.index ? 'true' : 'false' }
aria-label={ item.text }
ariaLabel={ item.text }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created #1621 for this "issue"

> { onRenderOption(item, this._onRenderOption) }</CommandButton>
);
}
Expand Down