Skip to content

Conversation

@rebeccaalpert
Copy link
Member

@rebeccaalpert rebeccaalpert commented May 21, 2025

I used a timeout here because we have islands and I wasn't sure if we wanted to specifically look for anchor links instead - let me know if that's the preferred solution.

Tested with CSS var links with content.ts commented in.

Fixes #56.

const hash = window.location.hash

// Without this, page would focus on anchor link without scrolling to it
history.replaceState(null, '', ' ')
Copy link
Member Author

Choose a reason for hiding this comment

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

Totally open to suggestions here if we hate this.

Copy link
Collaborator

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

lgtm, had a question below but not really blocking


.ws-heading {
position: relative;
scroll-margin-top: 3rem;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if I'm noticing any difference when removing this line, is it necessary for anything in particular?

Copy link
Member Author

@rebeccaalpert rebeccaalpert May 28, 2025

Choose a reason for hiding this comment

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

It just adds space above the scroll target!

Without:
Screenshot 2025-05-28 at 9 54 06 AM

With:
Screenshot 2025-05-28 at 9 54 22 AM

@rebeccaalpert rebeccaalpert merged commit a3cd3d6 into patternfly:main May 28, 2025
1 check passed
@github-actions
Copy link

🎉 This PR is included in version 1.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure pages handle anchors appropriately

3 participants