Skip to content
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

[Docs] Fix scroll to hash behavior #5915

Merged
merged 2 commits into from
May 23, 2022
Merged

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented May 20, 2022

Summary

From @miukimiu

I noticed on our site when the page load (the first time) the scroll-to functionality doesn't work as expected: https://elastic.github.io/eui/#/tabular-content/data-grid-cells-popovers#focus. It should scroll to the Focus section.

This PR adds a document readystate check to ensure DOM is done loading/shifting before scrolling to a hash section.

It also tweaks the header offset slightly account for new section spacing added in #5887

Checklist

  • Checked in Chrome, Safari, Edge, and Firefox

Other items are probably N/A as an internal only change

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5915/

@cee-chen
Copy link
Contributor Author

CLA status appears to have hung

@cee-chen cee-chen closed this May 20, 2022
@cee-chen cee-chen reopened this May 20, 2022
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5915/

Copy link
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @constancecchen. It looks great! 🎉

Tested in Chrome, Safari, Edge, and, Firefox.

@cee-chen cee-chen merged commit 49b78b6 into elastic:main May 23, 2022
@cee-chen cee-chen deleted the docs/scroll-to-hash branch May 23, 2022 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants