Skip to content
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

Add AriaDescription for ContextMenu items #15973

Merged
merged 4 commits into from
Dec 10, 2020

Conversation

SavannahBourgeois
Copy link
Collaborator

Pull request checklist

Description of changes

There are a few props that can be set on items to help give screen reader users more context. One of those is aria-DescribedBy which is a string of IDs that point to elements describing the item. The other is aria-Description which is often set as the description of the element or is placed into a hidden span and the ID of that span is added to the list of IDs in aria-DescribedBy. This second approach is better because it will merge the aria-DescribedBy IDs and concat them to be the aria-Description set on the element so you do not overwrite other aria-DescribedBy elements.

With this change, I add ariaDescribedBy and ariaDescription as options on IContextualMenuItem. If the user passes ariaDescription, we will generate a hidden span with the contents of that prop and set the ID of that span to the list of aria-DescribedBy.

I have added an example of different context menu types with ariaDescriptions and verified they are read out by the screen reader when "Hear advanced detail" is selected.

Focus areas to test

Contextual menus, keytips on contextual menus, screen reader

I already checked in this change for Master, this is adding it to V7 (#15770)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 18, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2d8f165:

Sandbox Source
Fluent UI Button Configuration
codesandbox-react-template Configuration

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Nov 18, 2020

Perf Analysis

No significant results to display.

All results

Scenario Render type 7.0 Ticks PR Ticks Iterations Status
BaseButton mount 957 960 5000
Breadcrumb mount 42362 42257 5000
Checkbox mount 1657 1665 5000
CheckboxBase mount 1392 1408 5000
ChoiceGroup mount 5311 5267 5000
ComboBox mount 975 942 1000
CommandBar mount 7818 7828 1000
ContextualMenu mount 13907 13517 1000
DefaultButton mount 1216 1221 5000
DetailsRow mount 3863 3869 5000
DetailsRowFast mount 3925 3898 5000
DetailsRowNoStyles mount 3688 3627 5000
Dialog mount 1591 1580 1000
DocumentCardTitle mount 1844 1813 1000
Dropdown mount 2678 2698 5000
FocusTrapZone mount 1800 1819 5000
FocusZone mount 1865 1898 5000
IconButton mount 1910 1848 5000
Label mount 338 330 5000
Layer mount 1987 2040 5000
Link mount 463 446 5000
MenuButton mount 1558 1608 5000
MessageBar mount 2106 2110 5000
Nav mount 3441 3430 1000
OverflowSet mount 1538 1523 5000
Panel mount 1510 1477 1000
Persona mount 853 872 1000
Pivot mount 1518 1620 1000
PrimaryButton mount 1345 1328 5000
Rating mount 8238 8278 5000
SearchBox mount 1414 1357 5000
Shimmer mount 2721 2756 5000
Slider mount 1579 1602 5000
SpinButton mount 5324 5267 5000
Spinner mount 427 410 5000
SplitButton mount 3471 3315 5000
Stack mount 525 550 5000
StackWithIntrinsicChildren mount 1586 1624 5000
StackWithTextChildren mount 5007 5093 5000
SwatchColorPicker mount 10850 10969 5000
TagPicker mount 2948 2930 5000
TeachingBubble mount 50502 50782 5000
Text mount 460 459 5000
TextField mount 1417 1511 5000
Toggle mount 890 884 5000
button mount 113 109 5000

@size-auditor
Copy link

size-auditor bot commented Nov 18, 2020

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react office-ui-fabric-react-ContextualMenu 151.579 kB 152.703 kB ExceedsTolerance     1.124 kB
office-ui-fabric-react office-ui-fabric-react-DocumentCard 208.387 kB 209.418 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-FloatingPicker 232.89 kB 233.921 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Pickers 276.09 kB 277.121 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Pivot 179.402 kB 180.433 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Dropdown 225.73 kB 226.761 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Dialog 203.664 kB 204.695 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Panel 194.014 kB 195.045 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-CommandBar 194.843 kB 195.874 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-SearchBox 180.515 kB 181.546 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-ComboBox 238.46 kB 239.491 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Nav 181.704 kB 182.735 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Facepile 203.186 kB 204.217 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-MessageBar 182.602 kB 183.633 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-TeachingBubble 198.685 kB 199.716 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Breadcrumb 192.502 kB 193.533 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Grid 174.199 kB 175.23 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-Button 187.135 kB 188.166 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-SwatchColorPicker 184.585 kB 185.616 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-SpinButton 186.536 kB 187.567 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-ButtonGrid 174.199 kB 175.23 kB ExceedsTolerance     1.031 kB
office-ui-fabric-react office-ui-fabric-react-SelectedItemsList 222.315 kB 223.343 kB ExceedsTolerance     1.028 kB

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: d4f609575c9abc89ee66d9fb816be5557adc4093 (build)

@SavannahBourgeois SavannahBourgeois changed the title Sareiff/ariadescr7 Add AriaDescription for ContextMenu items Nov 18, 2020
@SavannahBourgeois
Copy link
Collaborator Author

@ThomasMichon or @joschect can one of you take a look please? I would love to be able to get this in soon.

joschect
joschect previously approved these changes Dec 4, 2020
@joschect joschect closed this Dec 10, 2020
@joschect joschect reopened this Dec 10, 2020
@msft-fluent-ui-bot
Copy link
Collaborator

Hello @joschect!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msft-fluent-ui-bot) and give me an instruction to get started! Learn more here.

@joschect joschect merged commit 471b6af into microsoft:7.0 Dec 10, 2020
@msft-fluent-ui-bot
Copy link
Collaborator

🎉office-ui-fabric-react@v7.154.0 has been released which incorporates this pull request.:tada:

Handy links:

@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/react-examples@v0.10.0 has been released which incorporates this pull request.:tada:

Handy links:

@ecraig12345 ecraig12345 removed the needs cherry-pick Temporary label for PRs which may need to be cherry-picked to master label Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants