Are you willing to submit a PR to fix? No
Requested priority: High (accessibility)
Products/sites affected: Outlook
Setting the ariaLabel property on IComboBoxOption does not set the aria-label on the option. It only does so if useAriaLabelAsText is set to true, which results in the aria label being used as the preview text.
Related PRs:
https://github.com/OfficeDev/office-ui-fabric-react/pull/4540
https://github.com/OfficeDev/office-ui-fabric-react/pull/4722
Aria label can only be set if you want to use it as the preview text as well
Aria label can be set, and if you want to use it as the preview text you can use the existing useAriaLabelAsText property
See ComboBox._renderOption and ComboBox._getPreviewText, essentially leave _getPreviewText as is but update the aria-label props being set on the CommandButton or CheckBox to be "item.ariaLabel ? item.ariaLabel : item.text"
@natalieethell were you working on this? I'm not sure if that behavior suggested is even right. May be good to chat with @jspurlin
Hey @dzearing I am not actively working on this. I just moved the card from “Ready for Engineering” to “In PR” because I noticed there was a PR opened for it.
@natalieethell Ah oops I see it now :) thanks!
seems the PR for this fizzled out. something to look into during #6030? @ecraig12345
I was about to create a PR to allow a different value for aria-label, but it was basically the same as the PR closed above, which @jspurlin said was unnecessary.
My solution was to add a getAriaLabel similar to getPreviewText:
private _getPreviewText(item: IComboBoxOption): string {
return item.useAriaLabelAsText && item.ariaLabel ? item.ariaLabel : item.text;
}
private _getAriaLabel(item: IComboBoxOption): string {
return item.ariaLabel ? item.ariaLabel : item.text;
}
@jspurlin unless you think this approach is better than the closed PR, i'll let this issue close via "By Design"
@micahgodbolt , yeah, I think this should be closed as "by design" due to the issues I called out in https://github.com/OfficeDev/office-ui-fabric-react/pull/6797