[PR #5186] [MERGED] fix(docs): anchor link scrolling with conflict prevention #5834

Closed
opened 2026-03-13 12:38:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5186
Author: @Kinfe123
Created: 10/9/2025
Status: Merged
Merged: 10/9/2025
Merged by: @Bekacru

Base: canaryHead: fix/docs-smooth-anchor-scrolling


📝 Commits (2)

  • 0a3860f feat(docs): enhance anchor link scrolling with conflict prevention
  • 3abfad3 lint

📊 Changes

4 files changed (+122 additions, -4 deletions)

View changed files

📝 docs/app/global.css (+9 -3)
📝 docs/app/layout.tsx (+2 -0)
docs/components/anchor-scroll-fix.tsx (+107 -0)
📝 docs/components/docs/layout/nav.tsx (+4 -1)

📄 Description

closes #4658

Summary by cubic

Improved docs anchor link navigation with a custom smooth scroll that respects header offsets and avoids double-smoothing. Users land at the right position, and the navbar no longer flickers during anchor jumps.

  • New Features

    • Added AnchorScroll to handle hash changes and in-page anchor clicks with a custom, offset-aware smooth animation.
    • Uses CSS vars (--fd-nav-height, --fd-banner-height, --fd-tocnav-height) and +24px padding to compute accurate scroll offsets.
    • Switches scroll-behavior to auto during scripted scrolls via [data-anchor-scrolling]; smooth remains default otherwise.
  • Bug Fixes

    • Prevent navbar transparency updates while anchor scrolling; scroll listener is passive.
    • Removes jitter and incorrect offsets caused by native vs. scripted smooth scrolling on anchor clicks and hash loads.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5186 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 10/9/2025 **Status:** ✅ Merged **Merged:** 10/9/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/docs-smooth-anchor-scrolling` --- ### 📝 Commits (2) - [`0a3860f`](https://github.com/better-auth/better-auth/commit/0a3860feec42157bd6e1ef2b0abb6141cb4104f9) feat(docs): enhance anchor link scrolling with conflict prevention - [`3abfad3`](https://github.com/better-auth/better-auth/commit/3abfad388f9359e230eed1939a6afd5ca05baf94) lint ### 📊 Changes **4 files changed** (+122 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/app/global.css` (+9 -3) 📝 `docs/app/layout.tsx` (+2 -0) ➕ `docs/components/anchor-scroll-fix.tsx` (+107 -0) 📝 `docs/components/docs/layout/nav.tsx` (+4 -1) </details> ### 📄 Description closes #4658 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Improved docs anchor link navigation with a custom smooth scroll that respects header offsets and avoids double-smoothing. Users land at the right position, and the navbar no longer flickers during anchor jumps. - New Features - Added AnchorScroll to handle hash changes and in-page anchor clicks with a custom, offset-aware smooth animation. - Uses CSS vars (--fd-nav-height, --fd-banner-height, --fd-tocnav-height) and +24px padding to compute accurate scroll offsets. - Switches scroll-behavior to auto during scripted scrolls via [data-anchor-scrolling]; smooth remains default otherwise. - Bug Fixes - Prevent navbar transparency updates while anchor scrolling; scroll listener is passive. - Removes jitter and incorrect offsets caused by native vs. scripted smooth scrolling on anchor clicks and hash loads. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:38:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5834