-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Feature/dropdown ax #1625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature/dropdown ax #1625
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
94788f9
Fix some accessibility issues with Dropdown.
scriby 8f9d00b
Add change file
scriby a4dfcf0
Merge branch 'master' into feature/dropdown-ax
scriby 583efc1
Fix lint error
scriby f6d22d1
Merge branch 'feature/dropdown-ax' of github.com:scriby/office-ui-fab…
scriby c1cff14
Merge branch 'master' into feature/dropdown-ax
cschleiden 92cbdac
Merge branch 'master' into feature/dropdown-ax
cschleiden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
common/changes/scriby-dropdown-ax-fixes_2017-04-26-10-27.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' } | ||
|
|
@@ -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' | ||
| > | ||
| { this.props.options.map((item, index) => onRenderItem({ ...item, index }, this._onRenderItem)) } | ||
| </FocusZone> | ||
|
|
@@ -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 } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created #1621 for this "issue" |
||
| > { onRenderOption(item, this._onRenderOption) }</CommandButton> | ||
| ); | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!