-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Substantially improve accessibility of Dropdown component #5385
Substantially improve accessibility of Dropdown component #5385
Conversation
|
||
|
||
|
||
|
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.
spacing here?
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 weird..
selectedIndices = this._getSelectedIndexes(props.options, selectedKey!); | ||
} | ||
|
||
if (!props.multiSelect) { |
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.
could this be combined with the above else
?
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.
yes :)
Alright so there are some problems. As soon as I get to the page it keeps repeating "Select an Option, 1of 5, non-selected," |
@betrue-final-final assuming you are talking about my branch but look at my screen capture above, it isn't what you described... It in fact says the right thing. |
I'll send you my Narrator buddy output as soon as I get back to my computer. |
I don't know what to do if I cannot repro it though. Could you point to somewhere in the implementation that I should tweak? |
I just had a thought. I realize that the bug where it starts announcing the dropdowns without them being in focus I was in scan mode. I'm not totally sure how you would change the order of the text... |
My Narrator buddy output: Starting Narrator Buddy |
Ok, now the order seems correct, but I'm still getting unprompted dropdown output without focus. |
Hi @betrue-final-final, I believe I have fixed the issue where all options are read out. I also tested this with cases where a specific option is pre-selected the moment the page load. In all of these cases, we no longer read the options. Thanks for testing and reporting this behavior. |
/** | ||
* Options for the dropdown. | ||
*/ | ||
options: IDropdownOption[]; |
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.
Technically a breaking change since the API surface changed, but on the other hand, this is more akin to type tightening (fixing bugs in our type declaration so that they're better and catch more issues) and the way you fundamentally would expect the API surface to perform has not changed.
Just like as in the case with the Typescript compiler, our present position is that we do not consider these as major-version-only changes.
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.
This sounded great! Nice work Cliff.
Pull request checklist
$ npm run change
Description of changes
Substantially improves Dropdown accessibility, particularly for single select dropdown. Multi-select dropdown could still use some more polish, but is improved quite substantially as well with this change.
Also fixed various code issues and loose typings (e.g. the options props for Dropdown was of
any
type this entire time!!! we were calling super() in constructor twice!!!! We were mutating props!!! etc.)Microsoft Reviewers: Open in CodeFlow