Skip to content

Scroll is not restored after navigating with back button after swipe to top #53777

@l-you

Description

@l-you

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Current https://nextjs.org version is 13.4.17-canary.2

Which example does this report relate to?

https://nextjs.org

What browser are you using? (if relevant)

IOS Safari 16.6

Describe the Bug

When using the browser's provided back button following a quick upward swipe, the scroll position resets for the previous page.
Please note that this issue only occurs in iOS Safari and cannot be replicated in IOS Chrome.

Expected Behavior

Scroll position should be restored.

To Reproduce

  1. Visit https://nextjs.org.
  2. Scroll down to a sufficiently distant link.
  3. Click on that link.
  4. The navigation bar has disappeared. To return, swipe up quickly and then click the back navigation. (Usually, the combination of those actions performed quickly)
  5. The scroll position is not restored.

Please look at the following video.

6d05fcf7-318f-4dc3-85e4-6792e14fd6ba.mp4

Update:
Seems like a general bug for every website for both manual and auto scroll restoration only on IOS Safari.
Here is screen recording of reproduction on google.com website.

RPReplay_Final1692286299.2-2.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesIssue was opened via the examples template.not staleA previously `stale` marked issue that is no longer stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions