-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(docs): fix scroll selector to scroll to top on page change #4364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
It looks like there can be a slight delay for the page loading and the page title swap can happen after the anchor change, which feels a little weird. Is that a separate issue, or something we should look at in this PR?
Nov-11-2024.15-40-13.mp4
@mcoker good callout, I've moved the page scrolling inside the promise to trigger after page navigation 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@@ -117,7 +91,7 @@ export const TableOfContents = ({ items }) => { | |||
<JumpLinks | |||
label="Table of contents" | |||
isVertical | |||
scrollableSelector=".pf-v6-c-page__main-container" | |||
scrollableSelector="#ws-page-main" | |||
className="ws-toc" | |||
style={{ top: stickyNavHeight }} | |||
offset={width > 1450 ? 108 + stickyNavHeight : 148 + stickyNavHeight} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a new issue - but with the jumplinks collapsed, I notice that the scroll position puts the title underneath the jumplink toggle. The page switch looks 👌🏻 though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srambach I'm only able to recreate if I navigate to a jumplink on desktop layout and then shrink the screen down so the jumplinks move from the side to the top as seen in the video, did you see it anywhere else? Navigating from this point forward seems to work as expected at the new screen size.
Closes #4363
This PR fixes pages not scrolling to top when navigating to a new page.
It updates the Link component and TableOfContents component to revert the scrollSelector change from #4197 which is no longer needed after Core update patternfly/patternfly#7025 was merged.