pettiboy / react-ui-scrollspy

Customizable Scroll Spy component for react which is Simple, Easy To Use and Lightweight with callback, typescript, auto-update URL hash and throttle support among others.

Home Page:https://pettiboy.github.io/react-ui-scrollspy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested structure not supported

nifanic opened this issue · comments

Nice component, but doesn't seem supporting nested HTML structure, like—

<chapter>
  <header id="section1">Chapter 1</header>
  <main>
    <section>
      <header id="subheaderA">Subheader A</header>
    </section>
    <section>
      <header id="subheaderB">Subheader B</header>
    </section>
  </main>
</chapter>

In this example, if we are on Subheader A, react-ui-scrollspy will still highlight Chapter 1 as active.