Skip to content

Issues that remain scrolling when page is moved when padding-top(or margin-top) value is present in layout #80615

Open
@BoubleJ

Description

@BoubleJ

Link to the code that reproduces this issue

https://github.com/BoubleJ/scroll_test

To Reproduce

  1. Go to the about page
  2. Lower scrolling by approximately 50px (scrolling less than layout margin value)
  3. Go to the dashboard page through the top tab

Current vs. Expected behavior

Current Behavior

  1. Scroll top not moved

The scroll does not go to the top when moving the page after scrolling less than the padding value of the layout element.

Scroll.top.not.moved.mp4
  1. scroll to top

If you scroll more than the padding value of the layout element and move the page, the scroll normally goes to the top.

scroll.to.top.mp4

Expected Behavior

  1. I want to know why this happens.

  2. How can I get the scroll to go to the top normally even if I scroll less than the layout padding area and then go to the page

  3. If the layout area contains an element with a position-fixed attribute, it may be necessary to pad the layout area to show the content section at the bottom of the element.
    In this case, what should I do to move the scroll normally like video 2 when moving the page.

Provide environment information

Operating System:
  Platform: window
  Arch: x64
  Version: #1 SMP Tue June 17 21:38:13 KST 2025
Binaries:
  Node: 22.15.1
  npm: 11.4.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.3.3 // Latest available version is detected (14.2.8).
  eslint-config-next: 14.2.8
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Linking and Navigating, Route Handlers

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.Route HandlersRelated to Route Handlers.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions