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

feat: Adding span as an option for Link to render as #29937

Merged
merged 5 commits into from
Nov 29, 2023

Conversation

khmakoto
Copy link
Member

@khmakoto khmakoto commented Nov 29, 2023

PR Description

This PR adds as="span" as an option for the Link component to render as. When rendered as a span, the Link component will have role="button" set so the semantics for screen-reader are the same as when rendered as a button.

This change is done so we allow an option for a Link with no href to render inline and not as a block.

image

Related Issue(s)

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 29, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-link
Link
17.033 kB
6.884 kB
17.074 kB
6.892 kB
41 B
8 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.816 kB
20.132 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
207.953 kB
59.48 kB
react-components
react-components: FluentProvider & webLightTheme
42.101 kB
13.957 kB
react-portal-compat
PortalCompatProvider
6.822 kB
2.311 kB
🤖 This report was generated against 6438f49dcad090446fdec9b189a027751e8dca11

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 29, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 628 619 5000
Button mount 320 319 5000
Field mount 1163 1168 5000
FluentProvider mount 697 716 5000
FluentProviderWithTheme mount 75 77 10
FluentProviderWithTheme virtual-rerender 63 64 10
FluentProviderWithTheme virtual-rerender-with-unmount 71 74 10
MakeStyles mount 870 848 50000
Persona mount 1754 1690 5000
SpinButton mount 1366 1386 5000

@layershifter
Copy link
Member

@khmakoto can you please add a visual test for <Link as="span" /> to that scenario from #29600 works?

@khmakoto khmakoto requested a review from a team as a code owner November 29, 2023 19:54
Copy link

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 5edda99:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration
wispy-fog-78vkn5 Issue #29600

Copy link

size-auditor bot commented Nov 29, 2023

Asset size changes

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

Baseline commit: 6438f49dcad090446fdec9b189a027751e8dca11 (build)

@khmakoto khmakoto merged commit 3d31f25 into master Nov 29, 2023
26 checks passed
@khmakoto khmakoto deleted the feat/react-link/linkAsSpan branch November 29, 2023 23:16
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.

[Bug]: Link as button behaves like a block
4 participants