Skip to content

Problems with TOCs #1140

@cornae

Description

@cornae

To make a TOC, two methods can be used: pat-navigation or pat-scroll.

The desired behaviour consists of 3 parts.

  1. Scrolling needs to be smooth.
  2. Upon click of a TOC item, the TOC item must be highlighted (class current or similar).
  3. Upon scrolling, the highlighting of the TOC must be updated.

Pat-navigation

  1. ✅ Perfect, but only when native scrolling of browser is used with CSS.
  2. ✅ Perfect.
  3. ❌ Doesn't happen.

Adding TOC update behaviour to pat-navigation would be great. Suggested automatic classes:

in-view to highlight any TOC element of which its corresponding element is currently in view. (Can be multiple at the same time)
in-view-latest to highlight the TOC element that entered the latest. (Always only one at the time)

Pat-scroll

  1. ✅ Only perfect when not used in combination with CSS smooth scrolling. Otherwise both scrolling methods compete.
  2. ❌ Erratic behaviour.
  3. ❌ Doesn't update or in other situations it does, but erratic.

Would be solved if:

  • Bugs 2 and 3 would be fixed.
  • A property would be added to disable JavaScript animated scrolling. Suggested property: animation: none/auto.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions