SharePoint / SharePoint/sp-dev-docs
SharePoint Web Parts do not recover correctly when using browser back button
@Ashlesha-MSFT is already working on this.
Since Jun 30, 2026.
- 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
- Create a News Page
- On the home page, add a News Part that loads the News
- Click on the News Article
- Press
backin 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.