Skip to content

Conversation

@PelayoFelgueroso
Copy link
Collaborator

@PelayoFelgueroso PelayoFelgueroso commented Oct 15, 2025

Checklist
(Check off all the items before submitting)

  • Build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
Scroll to Top when we switch from when page to another

Copy link
Collaborator

@Mil4n0r Mil4n0r left a comment

Choose a reason for hiding this comment

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

No changes are required in _app or MainContent.

MainContent is causing this problem because it is part of the ApplicationLayout itself, and it is the one handling the scroll, not ApplicationLayout.Main. the thing is that we would need to have a ref to it (instead of an id).

By having the current useRef from ApplicationLayout pointing the MainContent instead of the whole content, we would be able to add inside the same file something like this:

  useEffect(() => {
    if (ref.current) {
      ref.current.scrollTop = 0;
    }
  }, [children]);

We should discuss it with @Jialecl to make sure it does not break anything though.

@Mil4n0r Mil4n0r self-assigned this Oct 15, 2025
@Mil4n0r Mil4n0r mentioned this pull request Oct 15, 2025
5 tasks
@Mil4n0r
Copy link
Collaborator

Mil4n0r commented Oct 20, 2025

LGTM, let's wait for @Jialecl to confirm though.

@PelayoFelgueroso PelayoFelgueroso marked this pull request as ready for review October 23, 2025 07:03
@PelayoFelgueroso PelayoFelgueroso changed the title Scroll Top Draft Fix scroll when we change from one page to another in the doc site Oct 24, 2025
@PelayoFelgueroso PelayoFelgueroso changed the title Fix scroll when we change from one page to another in the doc site ChatGPT Plus Fix scrolling when navigating between pages on the documentation site. Oct 24, 2025
@PelayoFelgueroso PelayoFelgueroso changed the title ChatGPT Plus Fix scrolling when navigating between pages on the documentation site. Plus Fix scrolling when navigating between pages on the documentation site. Oct 24, 2025
@PelayoFelgueroso PelayoFelgueroso changed the title Plus Fix scrolling when navigating between pages on the documentation site. Fix scrolling when navigating between pages on the documentation site. Oct 24, 2025
@Jialecl
Copy link
Collaborator

Jialecl commented Nov 3, 2025

This approach messes with the navigation to different sections. For example: if you navigate to a link that looks like https://(,,,).com/(...)/#intro it won't scroll to #intro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants