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

feat: Improve the jump-to-fragment fixup for non-heading targets #882

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

gibson042
Copy link
Member

Router logic was swallowing history entries and not scrolling far enough for such targets1 to clear the fixed header.

Footnotes

  1. which do not currently exist but are being added, cf. https://github.com/Agoric/documentation/pull/876#discussion_r1409657230

@gibson042 gibson042 requested a review from michaelfig November 29, 2023 23:43
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

Really nice! I'm impressed. 🥇

return () => window.removeEventListener(type, stopPropagation, true);
});
const passEvents = () => {
while (restorers.length > 0) restorers.pop()();
Copy link
Member

Choose a reason for hiding this comment

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

Any reasons for restorers.pop() instead of restorers.shift()? Maybe add a comment as to why, or why it doesn't matter.

Router logic was swallowing history entries and not scrolling far enough
for such targets to clear the fixed header.
@gibson042 gibson042 force-pushed the gibson-2023-11-scroll-to-non-toc-target branch from 45cbb4a to 23efb75 Compare November 30, 2023 02:52
@gibson042 gibson042 enabled auto-merge (rebase) November 30, 2023 02:53
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 23efb75
Status: ✅  Deploy successful!
Preview URL: https://f65cad36.documentation-7tp.pages.dev
Branch Preview URL: https://gibson-2023-11-scroll-to-non.documentation-7tp.pages.dev

View logs

@gibson042 gibson042 merged commit 8fe8467 into main Nov 30, 2023
4 checks passed
@gibson042 gibson042 deleted the gibson-2023-11-scroll-to-non-toc-target branch November 30, 2023 02:55
0xpatrickdev added a commit that referenced this pull request Mar 14, 2024
- removes code added in #882 that aimed to fix anchor tag linking on initial page loads as it no longer seems necessary with vitepress
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.

2 participants