Skip to content

Flash when scrolling / doesn't scroll to right spot #273

@kareem

Description

@kareem

I've noticed two issues with tocbot that seem unusual:

  1. The TOC flashes when I click on a link (maybe like the TOC is being redrawn)
  2. The document doesn't always scroll to the right place on page unless I click the link twice

Here's a video:
https://www.dropbox.com/s/e2zl8jd3srg4qns/screencast%202022-02-21%2022-05-56.mp4?dl=0

Code:

tocbot.init({ tocSelector: '.js-toc-list', contentSelector: '.js-toc-content', headingSelector: 'h2', hasInnerContainers: false, ignoreSelector: '.js-no-anchor', orderedList: false, headingsOffset: 70, scrollSmoothOffset: -70, }); 

I've read the docs and scoured closed issues and can't find anything that looks like a promising fix. Feels like I'm doing something wrong here / missing something.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions