Skip to content

fix(react-utilities): Add referrerPolicy to anchor native props whitelist - #35447

Merged
Dmytro Kirpa (dmytrokirpa) merged 5 commits into
masterfrom
copilot/fix-6154722-60537144-7d1fb147-17f1-40b1-a230-1cc30cd3dcfd
Nov 4, 2025
Merged

fix(react-utilities): Add referrerPolicy to anchor native props whitelist#35447
Dmytro Kirpa (dmytrokirpa) merged 5 commits into
masterfrom
copilot/fix-6154722-60537144-7d1fb147-17f1-40b1-a230-1cc30cd3dcfd

Conversation

Copilot AI commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Fix for referrerPolicy attribute issue in Link component ✅

Issue: The referrerPolicy property of the Link component was not being applied to the rendered anchor element.

Root Cause: The referrerPolicy attribute was missing from the anchorProperties whitelist in the properties filtering system.

Changes Made:

  • Added referrerPolicy to anchorProperties array in properties.ts (line 211)
  • Added comprehensive test case to verify referrerPolicy is properly handled for anchor elements
  • Removed unnecessary type-casting from test assertion
  • Generated change file using yarn change

Files Changed:

  • packages/react-components/react-utilities/src/utils/properties.ts - Added referrerPolicy to the anchor properties whitelist
  • packages/react-components/react-utilities/src/utils/properties.test.ts - Added test to verify anchor properties including referrerPolicy
  • change/@fluentui-react-utilities-75cdb456-2717-4c91-abf0-756ad84f4720.json - Change file for version bump

Testing:

  • ✅ Unit test added specifically for referrerPolicy in anchor props
  • ✅ All 321 existing tests in react-utilities continue to pass
  • ✅ Package builds successfully
  • ✅ Linting passes with no new warnings
  • ✅ Code review passed with no issues
  • ✅ Security check completed

Result:
The Link component now properly passes the referrerPolicy attribute to the rendered <a> element, allowing developers to control the Referer header sent when following links.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: The referrerPolicy property of the Link component is not working</issue_title>
<issue_description>### Component

Link

Package version

9.70.0

React version

18.2.0

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (6) x64 Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
    Memory: 11.24 GB / 31.88 GB
  Browsers:
    Chrome: 141.0.7390.123
    Edge: Chromium (140.0.3485.54)
    Internet Explorer: 11.0.19041.5794
  npmPackages:
    @fluentui/react-components: ^9.70.0 => 9.70.0
    @types/react: ^18.2.21 => 18.2.21
    @types/react-dom: ^18.2.7 => 18.2.7
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0

Current Behavior

The referrerPolicy property of the Link component is not working. I assigned a value to it in the code, but this property does not appear in the rendered result.

The code:

<Link href="https://www.bing.com" referrerPolicy="no-referrer">
    This is a link
</Link>

The rendered result:

<a
 href="https://www.bing.com"
 tabindex="0"
 class="fui-Link ___1fq7916 f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f1iuv45f f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a"
>
This is a link
</a>

Expected Behavior

The rendered result:

<a
 href="https://www.bing.com"
 tabindex="0"
 referrerpolicy="no-referrer"
 class="fui-Link ___1fq7916 f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f1iuv45f f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a"
>
This is a link
</a>

Reproduction

https://stackblitz.com/edit/ylw9zmvs?file=src%2Fexample.tsx

Steps to reproduce

See above

Are you reporting an Accessibility issue?

no

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.</issue_description>

<agent_instructions>Add the referrerPolicy attribute to the whitelist https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-utilities/src/utils/properties.ts#L206 and update corresponding tests if needed

</agent_instructions>

Comments on the Issue (you are Copilot in this section)

Dmytro Kirpa (@dmytrokirpa) I can confirm the bug, it happens because the `referrerPolicy` attribute is missing in the prop whitelist https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-utilities/src/utils/properties.ts#L206. We need to add it there

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Comment thread packages/react-components/react-utilities/src/utils/properties.test.ts Outdated
@dmytrokirpa

Copy link
Copy Markdown
Contributor

Copilot generate a change file using the yarn change command

Copilot AI changed the title [WIP] [Bug]: The referrerPolicy property of the Link component is not working Nov 3, 2025
@github-actions

github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-accordion
Accordion (including children components)
108.245 kB
33.152 kB
108.262 kB
33.154 kB
17 B
2 B
react-avatar
Avatar
48.555 kB
15.528 kB
48.572 kB
15.53 kB
17 B
2 B
react-avatar
AvatarGroup
19.235 kB
7.617 kB
19.252 kB
7.618 kB
17 B
1 B
react-avatar
AvatarGroupItem
62.699 kB
19.747 kB
62.716 kB
19.749 kB
17 B
2 B
react-badge
Badge
25.089 kB
8.256 kB
25.106 kB
8.258 kB
17 B
2 B
react-badge
CounterBadge
25.869 kB
8.53 kB
25.886 kB
8.532 kB
17 B
2 B
react-badge
PresenceBadge
24.97 kB
9.163 kB
24.987 kB
9.165 kB
17 B
2 B
react-breadcrumb
@fluentui/react-breadcrumb - package
114.23 kB
31.551 kB
114.247 kB
31.553 kB
17 B
2 B
react-button
Button
36.705 kB
10.508 kB
36.722 kB
10.51 kB
17 B
2 B
react-button
CompoundButton
43.117 kB
11.812 kB
43.134 kB
11.814 kB
17 B
2 B
react-button
MenuButton
41.642 kB
11.917 kB
41.659 kB
11.918 kB
17 B
1 B
react-button
SplitButton
49.702 kB
13.496 kB
49.719 kB
13.498 kB
17 B
2 B
react-button
ToggleButton
52.636 kB
12.285 kB
52.653 kB
12.287 kB
17 B
2 B
react-card
Card - All
106.019 kB
29.801 kB
106.036 kB
29.803 kB
17 B
2 B
react-card
Card
98.665 kB
27.926 kB
98.682 kB
27.928 kB
17 B
2 B
react-card
CardFooter
13.662 kB
5.517 kB
13.679 kB
5.519 kB
17 B
2 B
react-card
CardHeader
16.195 kB
6.38 kB
16.212 kB
6.382 kB
17 B
2 B
react-card
CardPreview
13.729 kB
5.645 kB
13.746 kB
5.646 kB
17 B
1 B
react-charts
AreaChart
387.402 kB
118.1 kB
387.419 kB
118.103 kB
17 B
3 B
react-charts
DeclarativeChart
696.351 kB
200.579 kB
696.368 kB
200.584 kB
17 B
5 B
react-charts
DonutChart
296.997 kB
88.73 kB
297.014 kB
88.733 kB
17 B
3 B
react-charts
FunnelChart
288.153 kB
85.63 kB
288.17 kB
85.633 kB
17 B
3 B
react-charts
GanttChart
368.914 kB
111.131 kB
368.931 kB
111.133 kB
17 B
2 B
react-charts
GaugeChart
311.772 kB
92.386 kB
311.789 kB
92.389 kB
17 B
3 B
react-charts
GroupedVerticalBarChart
376.94 kB
113.668 kB
376.957 kB
113.671 kB
17 B
3 B
react-charts
HeatMapChart
370.883 kB
112.699 kB
370.9 kB
112.701 kB
17 B
2 B
react-charts
HorizontalBarChart
296.397 kB
87.289 kB
296.414 kB
87.291 kB
17 B
2 B
react-charts
Legends
235.132 kB
69.571 kB
235.149 kB
69.572 kB
17 B
1 B
react-charts
LineChart
396.626 kB
119.59 kB
396.643 kB
119.593 kB
17 B
3 B
react-charts
SankeyChart
199.128 kB
61.213 kB
199.145 kB
61.216 kB
17 B
3 B
react-charts
ScatterChart
376.457 kB
113.622 kB
376.474 kB
113.624 kB
17 B
2 B
react-charts
VerticalBarChart
411.454 kB
119.189 kB
411.471 kB
119.191 kB
17 B
2 B
react-charts
VerticalStackedBarChart
383.27 kB
115.032 kB
383.287 kB
115.032 kB
17 B
react-checkbox
Checkbox
34.414 kB
11.801 kB
34.431 kB
11.803 kB
17 B
2 B
react-color-picker
ColorArea
49.32 kB
17.32 kB
49.337 kB
17.321 kB
17 B
1 B
react-color-picker
ColorPicker
17.95 kB
7.143 kB
17.967 kB
7.145 kB
17 B
2 B
react-color-picker
ColorSlider
41.493 kB
15.375 kB
41.51 kB
15.377 kB
17 B
2 B
react-combobox
Combobox (including child components)
106.965 kB
34.798 kB
106.982 kB
34.8 kB
17 B
2 B
react-combobox
Dropdown (including child components)
107.595 kB
34.722 kB
107.612 kB
34.724 kB
17 B
2 B
react-components
react-components: Button, FluentProvider & webLightTheme
68.796 kB
19.903 kB
68.813 kB
19.905 kB
17 B
2 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.635 kB
68.578 kB
236.652 kB
68.58 kB
17 B
2 B
react-components
react-components: FluentProvider & webLightTheme
43.63 kB
14.257 kB
43.647 kB
14.259 kB
17 B
2 B
react-components
react-components: entire library
1.279 MB
321.375 kB
1.279 MB
321.377 kB
17 B
2 B
react-datepicker-compat
DatePicker Compat
226.662 kB
64.124 kB
226.679 kB
64.125 kB
17 B
1 B
react-dialog
Dialog (including children components)
103.725 kB
30.96 kB
103.742 kB
30.963 kB
17 B
3 B
react-divider
Divider
20.626 kB
7.654 kB
20.643 kB
7.656 kB
17 B
2 B
react-field
Field
22.697 kB
8.603 kB
22.714 kB
8.606 kB
17 B
3 B
react-image
Image
14.473 kB
5.919 kB
14.49 kB
5.922 kB
17 B
3 B
react-input
Input
27.148 kB
9.108 kB
27.165 kB
9.11 kB
17 B
2 B
react-label
Label
13.799 kB
5.644 kB
13.816 kB
5.645 kB
17 B
1 B
react-link
Link
16.746 kB
6.785 kB
16.763 kB
6.786 kB
17 B
1 B
react-list
List
88.897 kB
26.388 kB
88.914 kB
26.39 kB
17 B
2 B
react-list
ListItem
112.479 kB
33.25 kB
112.496 kB
33.256 kB
17 B
6 B
react-menu
Menu (including children components)
165.361 kB
50.086 kB
165.378 kB
50.096 kB
17 B
10 B
react-menu
Menu (including selectable components)
168.343 kB
50.668 kB
168.36 kB
50.67 kB
17 B
2 B
react-message-bar
MessageBar (all components)
24.157 kB
8.983 kB
24.174 kB
8.984 kB
17 B
1 B
react-persona
Persona
55.446 kB
17.41 kB
55.463 kB
17.411 kB
17 B
1 B
react-popover
Popover
132.259 kB
41.165 kB
132.276 kB
41.167 kB
17 B
2 B
react-progress
ProgressBar
16.593 kB
6.613 kB
16.61 kB
6.615 kB
17 B
2 B
react-provider
FluentProvider
23.806 kB
8.557 kB
23.823 kB
8.559 kB
17 B
2 B
react-radio
Radio
31.8 kB
10.006 kB
31.817 kB
10.007 kB
17 B
1 B
react-radio
RadioGroup
14.889 kB
6.09 kB
14.906 kB
6.091 kB
17 B
1 B
react-select
Select
26.987 kB
9.848 kB
27.004 kB
9.85 kB
17 B
2 B
react-slider
Slider
37.211 kB
12.461 kB
37.228 kB
12.463 kB
17 B
2 B
react-spinbutton
SpinButton
34.468 kB
11.453 kB
34.485 kB
11.455 kB
17 B
2 B
react-spinner
Spinner
24.396 kB
8.201 kB
24.413 kB
8.203 kB
17 B
2 B
react-swatch-picker
@fluentui/react-swatch-picker - package
106.057 kB
30.56 kB
106.074 kB
30.563 kB
17 B
3 B
react-switch
Switch
34.55 kB
11.013 kB
34.567 kB
11.014 kB
17 B
1 B
react-table
DataGrid
161.176 kB
45.567 kB
161.193 kB
45.568 kB
17 B
1 B
react-table
Table (Primitives only)
41.975 kB
13.575 kB
41.992 kB
13.576 kB
17 B
1 B
react-table
Table as DataGrid
131.499 kB
36.357 kB
131.516 kB
36.36 kB
17 B
3 B
react-table
Table (Selection only)
69.887 kB
19.719 kB
69.904 kB
19.72 kB
17 B
1 B
react-table
Table (Sort only)
68.53 kB
19.333 kB
68.547 kB
19.334 kB
17 B
1 B
react-tag-picker
@fluentui/react-tag-picker - package
188.335 kB
56.463 kB
188.352 kB
56.465 kB
17 B
2 B
react-tags
InteractionTag
14.561 kB
5.865 kB
14.578 kB
5.866 kB
17 B
1 B
react-tags
Tag
30.413 kB
9.802 kB
30.43 kB
9.803 kB
17 B
1 B
react-tags
TagGroup
83.1 kB
24.563 kB
83.117 kB
24.564 kB
17 B
1 B
react-text
Text - Default
16.19 kB
6.366 kB
16.207 kB
6.368 kB
17 B
2 B
react-text
Text - Wrappers
19.35 kB
6.695 kB
19.367 kB
6.696 kB
17 B
1 B
react-textarea
Textarea
25.53 kB
9.361 kB
25.547 kB
9.363 kB
17 B
2 B
react-timepicker-compat
TimePicker
109.931 kB
36.336 kB
109.948 kB
36.338 kB
17 B
2 B
react-toast
Toast (including Toaster)
103.322 kB
30.969 kB
103.339 kB
30.971 kB
17 B
2 B
react-tree
FlatTree
149.073 kB
42.66 kB
149.09 kB
42.662 kB
17 B
2 B
react-tree
PersonaFlatTree
149.831 kB
42.791 kB
149.848 kB
42.793 kB
17 B
2 B
react-tree
PersonaTree
146.096 kB
41.652 kB
146.113 kB
41.654 kB
17 B
2 B
react-tree
Tree
145.346 kB
41.528 kB
145.363 kB
41.53 kB
17 B
2 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
510 B
328 B
global-context
createContextSelector
537 B
339 B
react-aria
ARIA - Default
237 B
181 B
react-calendar-compat
Calendar Compat
149.805 kB
39.967 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Sparkline
91.098 kB
28.693 kB
react-jsx-runtime
Classic Pragma
1.101 kB
550 B
react-jsx-runtime
JSX Dev Runtime
2.8 kB
1.251 kB
react-jsx-runtime
JSX Runtime
3.422 kB
1.493 kB
react-motion
@fluentui/react-motion - createMotionComponent()
4.109 kB
1.806 kB
react-motion
@fluentui/react-motion - createPresenceComponent()
5.771 kB
2.396 kB
react-motion
@fluentui/react-motion - PresenceGroup
1.727 kB
823 B
react-overflow
hooks only
12.869 kB
4.807 kB
react-portal
Portal
15.395 kB
5.377 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-positioning
usePositioning
28.865 kB
10.146 kB
react-positioning
useSafeZoneArea
12.29 kB
4.967 kB
react-teaching-popover
TeachingPopover
102.752 kB
30.741 kB
react-tooltip
Tooltip
58.019 kB
20.119 kB
react-utilities
SSRProvider
180 B
160 B
🤖 This report was generated against 77df4fe3220557c4f72d6ce8492b0d198cc1119d
@github-actions

github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown

Pull request demo site: URL

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) merged commit 68eec6f into master Nov 4, 2025
16 checks passed
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) deleted the copilot/fix-6154722-60537144-7d1fb147-17f1-40b1-a230-1cc30cd3dcfd branch December 4, 2025 09:46
Tudor Popa (tudorpopams) pushed a commit to tudorpopams/fluentui that referenced this pull request Apr 14, 2026
…list (microsoft#35447)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Co-authored-by: Dmytro Kirpa <dmytrokirpa@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment