Skip to content

Conversation

@brianferry
Copy link
Collaborator

@brianferry brianferry commented Jun 11, 2025

What I did

ScrollSpyController

  1. Added a destinationTarget property for when an activeLink is set.
  2. When the destinationTarget comes into view, it sets the #force flag to false and clears the destinationTarget.

There is a race condition that is causing this issue RedHat-UX/red-hat-design-system#2425 where the rh-jump-link component gets out of sync during a programmatic scroll event.

What we're doing here is instead looking to see if we've arrived at the destinationTarget and that the destinationTarget is intersected before we continue on with the onIo action.

Testing Instructions

This is a fix that will be felt upstream in RHDS

  1. Build the project
  2. Link the project or overwrite your scroll-spy-controller.js files in rhds-elements
  3. Confirm that [bug] <rh-jump-links> Active state not consistent RedHat-UX/red-hat-design-system#2425 is not an issue for you anymore.

Notes to Reviewers

@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit cdbc788
😎 Deploy Preview https://deploy-preview-2911--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 11, 2025

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "fix(core): prevent race condition on programmatic scroll"
}

@github-actions github-actions bot added the AT passed Automated testing has passed label Jun 11, 2025
@github-actions

This comment has been minimized.

@bennypowers
Copy link
Member

see also #2920

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

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants