SharePoint / SharePoint/sp-dev-docs

SharePoint Web Parts do not recover correctly when using browser back button

Open
#10,927 7 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Jun 30, 2026.

area:spfx sharepoint-developer-support type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details

SPFx 1.21.1 (Though it affects all versions of SPFX and first-party SharePoint Web Parts)

Describe the bug / error

When a user clicks a link from Page1.aspx to Page2.aspx and presses the Browser back button mid-navigation event, the SharePoint page lifecycle is not recovering correctly. The Browser URL accurately shows Page1.aspx, but the Web Parts are still trying to load from Page2.aspx

This is causing an issue with our custom web parts which utilize URL parameters. As we load a page such as Page2.aspx?k="" and the Web Parts are loading data based on that... however pressing back changes the URL, but doesn't change the loaded Web Parts. However, to demonstrate, this behavior also exists in first party scenarios using out of the box components.

See below. I click a link from News Web Part, and while it's loading the News page, I press back in the browser. The URL correctly updates, but the page is still loading the previous news page web parts.

https://github.com/user-attachments/assets/d44f92a6-3ce6-4662-918d-a7fd09df6724

We can mitigate this issue in custom code by disabling data-interception, however, we cannot control the out of the box experience. Also, disabling data-interception to off is not a great experience due to the performance impact.

This behavior has manifested itself in the past in various ways, but I believe them to all be related:
https://github.com/SharePoint/sp-dev-docs/issues/8913
https://github.com/SharePoint/sp-dev-docs/issues/5604

Steps to reproduce
  1. Create a News Page
  2. On the home page, add a News Part that loads the News
  3. Click on the News Article
  4. Press back in the browser before the page full loads
Expected behavior

When pressing back in the browser mid navigation event, the SharePoint page should correctly recover the proper Web Parts for the loaded page... whether using first-party web parts or custom SPFx web parts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.