Skip to content

Conversation

@dynamicdhxx
Copy link

Description

Fixes the table of contents functionality on blog pages. TOC items now properly scroll to their corresponding sections when clicked.

Changes

  • Fixed ID mismatch between TOC items and heading elements
  • TOC items now use sanitized IDs that match heading element IDs
  • Added cursor-pointer class for better UX
  • Updated handleItemClick to use sanitized IDs correctly
  • Fixed dropdown click handler to use correct ID format

Testing

  • Tested locally on blog pages
  • TOC items now properly scroll to sections when clicked
  • URL hash updates correctly
  • Works on both desktop and mobile views

Issue

The table of contents showed pointer cursor on hover but clicking did nothing. This was due to ID mismatch between TOC items (using raw text) and heading elements (using sanitized IDs).

- Fixed ID mismatch between TOC items and heading elements
- TOC items now use sanitized IDs that match heading element IDs
- Added cursor-pointer class for better UX
- Updated handleItemClick to use sanitized IDs correctly
- Fixed dropdown click handler to use correct ID format
- Table of contents items now properly scroll to their sections when clicked

Fixes table of contents navigation on blog pages

Signed-off-by: Dhruv Bharuka <iit2022015@iiitl.ac.in>
- Fixed ID mismatch between TOC items and heading elements
- TOC items now use sanitized IDs that match heading element IDs
- Added cursor-pointer class for better UX
- Updated handleItemClick to use sanitized IDs correctly
- Fixed dropdown click handler to use correct ID format
- Table of contents items now properly scroll to their sections when clicked

Fixes table of contents navigation on blog pages

Signed-off-by: Dhruv Bharuka <iit2022015@iiitl.ac.in>
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.

1 participant