Skip to content

Link: Fixing issues found in a11y review#19926

Merged
khmakoto merged 3 commits intomicrosoft:masterfrom
khmakoto:linkAccessibility
Sep 24, 2021
Merged

Link: Fixing issues found in a11y review#19926
khmakoto merged 3 commits intomicrosoft:masterfrom
khmakoto:linkAccessibility

Conversation

@khmakoto
Copy link
Member

Pull request checklist

Description of changes

This PR fixes a bunch of issues found as part of a manual accessibility review of the Link component and adds/updates tests to reflect these and other behaviors.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 23, 2021

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 e94f991:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Sep 23, 2021

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: dc356cba1b091612cb26b0527cc38665c4e95c46 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 23, 2021

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-link
Link
11.677 kB
4.611 kB
11.669 kB
4.607 kB
8 B
4 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-button
Button
23.286 kB
7.057 kB
react-button
CompoundButton
28.598 kB
7.905 kB
react-button
MenuButton
25.48 kB
7.743 kB
react-button
Button
30.879 kB
8.858 kB
react-button
ToggleButton
32.986 kB
7.681 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
165.607 kB
46.977 kB
react-components
react-components: FluentProvider & webLightTheme
35.77 kB
11.405 kB
🤖 This report was generated against dc356cba1b091612cb26b0527cc38665c4e95c46

it('cannot be focused when rendered as an anchor and disabled has been passed to the component', () => {
const rootRef = React.createRef<HTMLAnchorElement>();

wrapper = mount(
Copy link
Contributor

Choose a reason for hiding this comment

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

please convert these test to use @testing-library/react

Copy link
Member Author

Choose a reason for hiding this comment

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

Made a new issue to address separately here #19940


// Add role="link" for disabled and disabledFocusable links.
if (disabled || disabledFocusable) {
state.root.role = role || 'link';
Copy link
Contributor

Choose a reason for hiding this comment

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

when the DOM element is rendered as an anchor why do we need to add the same role to the element ?

Copy link
Member Author

@khmakoto khmakoto Sep 23, 2021

Choose a reason for hiding this comment

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

In talking with @smhigley she was telling me that a Link without an href (which we drop when the Link is disabled) is semantically treated as a span, which makes setting aria-disabled: true moot when disabled or disabledFocusable are passed in. One way to give it the correct semantic meaning of a disabled Link to accessibility tools is to add role="link" when this happens.

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 23, 2021

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 948 952 5000
BaseButton mount 929 904 5000
Breadcrumb mount 2659 2624 1000
ButtonNext mount 494 429 5000
Checkbox mount 1539 1576 5000
CheckboxBase mount 1273 1313 5000
ChoiceGroup mount 4825 4765 5000
ComboBox mount 1067 954 1000
CommandBar mount 10393 10520 1000
ContextualMenu mount 6625 6654 1000
DefaultButton mount 1154 1158 5000
DetailsRow mount 3879 3843 5000
DetailsRowFast mount 3827 3801 5000
DetailsRowNoStyles mount 3598 3595 5000
Dialog mount 2476 2596 1000
DocumentCardTitle mount 150 143 1000
Dropdown mount 3253 3263 5000
FluentProviderNext mount 7394 7472 5000
FluentProviderWithTheme mount 341 367 10
FluentProviderWithTheme virtual-rerender 99 104 10
FluentProviderWithTheme virtual-rerender-with-unmount 460 475 10
FocusTrapZone mount 2033 1887 5000
FocusZone mount 1899 1812 5000
IconButton mount 1853 1763 5000
Label mount 354 330 5000
Layer mount 3027 3039 5000
Link mount 459 494 5000
MakeStyles mount 1842 1908 50000
MenuButton mount 1509 1498 5000
MessageBar mount 2067 2103 5000
Nav mount 3344 3311 1000
OverflowSet mount 1104 1110 5000
Panel mount 2395 2399 1000
Persona mount 876 830 1000
Pivot mount 1447 1487 1000
PrimaryButton mount 1255 1273 5000
Rating mount 7985 7897 5000
SearchBox mount 1320 1403 5000
Shimmer mount 2588 2656 5000
Slider mount 1968 2061 5000
SpinButton mount 5015 5330 5000
Spinner mount 422 424 5000
SplitButton mount 3224 3204 5000
Stack mount 501 510 5000
StackWithIntrinsicChildren mount 1813 1693 5000
StackWithTextChildren mount 4745 4626 5000
SwatchColorPicker mount 10716 10742 5000
Tabs mount 1423 1407 1000
TagPicker mount 2692 2713 5000
TeachingBubble mount 13427 13577 5000
Text mount 416 430 5000
TextField mount 1400 1388 5000
ThemeProvider mount 1186 1197 5000
ThemeProvider virtual-rerender 601 608 5000
ThemeProvider virtual-rerender-with-unmount 1919 1967 5000
Toggle mount 848 828 5000
buttonNative mount 127 115 5000

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AvatarMinimalPerf.default 216 185 1.17:1
AttachmentMinimalPerf.default 178 154 1.16:1
BoxMinimalPerf.default 379 332 1.14:1
AlertMinimalPerf.default 302 267 1.13:1
AccordionMinimalPerf.default 168 152 1.11:1
TextMinimalPerf.default 353 322 1.1:1
CarouselMinimalPerf.default 500 459 1.09:1
ListNestedPerf.default 589 548 1.07:1
VideoMinimalPerf.default 671 630 1.07:1
DropdownManyItemsPerf.default 715 672 1.06:1
LabelMinimalPerf.default 408 386 1.06:1
ChatMinimalPerf.default 672 637 1.05:1
RefMinimalPerf.default 253 241 1.05:1
CardMinimalPerf.default 574 553 1.04:1
FlexMinimalPerf.default 296 284 1.04:1
SegmentMinimalPerf.default 353 340 1.04:1
TooltipMinimalPerf.default 1065 1022 1.04:1
ButtonMinimalPerf.default 184 179 1.03:1
ButtonOverridesMissPerf.default 1894 1847 1.03:1
LoaderMinimalPerf.default 723 705 1.03:1
MenuMinimalPerf.default 867 840 1.03:1
PortalMinimalPerf.default 184 179 1.03:1
TreeMinimalPerf.default 804 779 1.03:1
DividerMinimalPerf.default 370 363 1.02:1
HeaderSlotsPerf.default 779 767 1.02:1
ImageMinimalPerf.default 377 371 1.02:1
ListMinimalPerf.default 528 516 1.02:1
PopupMinimalPerf.default 621 606 1.02:1
ButtonSlotsPerf.default 576 568 1.01:1
ChatWithPopoverPerf.default 379 377 1.01:1
InputMinimalPerf.default 1336 1317 1.01:1
ItemLayoutMinimalPerf.default 1253 1239 1.01:1
MenuButtonMinimalPerf.default 1670 1646 1.01:1
ProviderMergeThemesPerf.default 1780 1769 1.01:1
ProviderMinimalPerf.default 1160 1146 1.01:1
ReactionMinimalPerf.default 376 373 1.01:1
StatusMinimalPerf.default 686 678 1.01:1
ToolbarMinimalPerf.default 962 957 1.01:1
AnimationMinimalPerf.default 422 420 1:1
ChatDuplicateMessagesPerf.default 312 313 1:1
DatepickerMinimalPerf.default 5536 5549 1:1
ListWith60ListItems.default 657 660 1:1
RadioGroupMinimalPerf.default 454 454 1:1
TextAreaMinimalPerf.default 503 505 1:1
AttachmentSlotsPerf.default 1110 1119 0.99:1
DropdownMinimalPerf.default 3314 3340 0.99:1
EmbedMinimalPerf.default 4378 4431 0.99:1
GridMinimalPerf.default 340 345 0.99:1
RosterPerf.default 1199 1208 0.99:1
SplitButtonMinimalPerf.default 4254 4279 0.99:1
TableManyItemsPerf.default 1916 1938 0.99:1
CustomToolbarPrototype.default 4198 4235 0.99:1
CheckboxMinimalPerf.default 2737 2798 0.98:1
FormMinimalPerf.default 390 399 0.98:1
SliderMinimalPerf.default 1752 1788 0.98:1
IconMinimalPerf.default 604 617 0.98:1
TreeWith60ListItems.default 190 194 0.98:1
LayoutMinimalPerf.default 370 380 0.97:1
SkeletonMinimalPerf.default 343 357 0.96:1
DialogMinimalPerf.default 763 806 0.95:1
HeaderMinimalPerf.default 353 372 0.95:1
ListCommonPerf.default 623 659 0.95:1
TableMinimalPerf.default 386 408 0.95:1

Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

Just the one testing typo, otherwise looks good!

@khmakoto khmakoto merged commit 6f977b6 into microsoft:master Sep 24, 2021
@khmakoto khmakoto deleted the linkAccessibility branch September 24, 2021 19:47
mlp73 pushed a commit to mlp73/fluentui that referenced this pull request Jan 17, 2022
* Link: Fixing issues found in a11y review.

* Change files

* Fixing typo in tests.
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.

Converged Link A11y updates list

5 participants