Skip to content

fix: avoid flash of page scrolling to top on refresh#7342

Merged
Josh-Cena merged 1 commit into
mainfrom
slorber/fix-lifecycle-bug
May 5, 2022
Merged

fix: avoid flash of page scrolling to top on refresh#7342
Josh-Cena merged 1 commit into
mainfrom
slorber/fix-lifecycle-bug

Conversation

@slorber

@slorber slorber commented May 5, 2022

Copy link
Copy Markdown
Collaborator

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Fix regression of #6732

On page refresh, we scroll to top for a while instead of keeping previous scroll position

The code that scrolls to top/anchor after a navigation should not be executed on first page load (like it used to be)

Test Plan

preview does not

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

#6732

@slorber slorber requested review from Josh-Cena and lex111 as code owners May 5, 2022 11:11
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 5, 2022
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 5, 2022
@netlify

netlify Bot commented May 5, 2022

Copy link
Copy Markdown

[V2]

Name Link
🔨 Latest commit b8e6e2a
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6273b10045f334000ae103e2
😎 Deploy Preview https://deploy-preview-7342--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

github-actions Bot commented May 5, 2022

Copy link
Copy Markdown

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 66 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 88 🟢 99 🟢 100 🟢 100 🟢 90 Report

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It works 👍

@github-actions

github-actions Bot commented May 5, 2022

Copy link
Copy Markdown

Size Change: +17 B (0%)

Total Size: 807 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 51.3 kB 0 B
website/build/assets/css/styles.********.css 105 kB 0 B
website/build/assets/js/main.********.js 612 kB +17 B (0%)
website/build/index.html 38.8 kB 0 B

compressed-size-action

@Josh-Cena Josh-Cena changed the title fix: fix lifecycle scrollTo issue on load fix: avoid flash of page scrolling to top on refresh May 5, 2022
@Josh-Cena Josh-Cena merged commit dfe743c into main May 5, 2022
@Josh-Cena Josh-Cena deleted the slorber/fix-lifecycle-bug branch May 5, 2022 11:39
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants