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

fix: detect active and exact active link #64

Merged
merged 1 commit into from
Feb 15, 2021
Merged

fix: detect active and exact active link #64

merged 1 commit into from
Feb 15, 2021

Conversation

farnabaz
Copy link
Collaborator

@farnabaz farnabaz commented Feb 15, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Refactor active link detection of TOC and user scroll listener instead of InsersectionObserver. resolves #63

A link will mark as active if:

  • It become visible in upper half of page
  • It has a active child

image

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@vercel
Copy link

vercel bot commented Feb 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nuxtlabs/docus/pduvr17yg
✅ Preview: https://docus-git-toc-highlight.nuxtlabs.vercel.app

@farnabaz farnabaz requested a review from atinux February 15, 2021 16:52
@atinux atinux merged commit 44ba5f8 into main Feb 15, 2021
@atinux atinux deleted the toc-highlight branch February 15, 2021 17:15
Tahul pushed a commit that referenced this pull request Apr 20, 2022
Tahul pushed a commit that referenced this pull request Apr 20, 2022
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.

Improve active link on Table of Contents
2 participants