tech-docs-gem icon indicating copy to clipboard operation
tech-docs-gem copied to clipboard

In-page-navigation can select wrong item when header is not first element

Open kevindew opened this issue 8 years ago • 0 comments

If you have content above the first header in the page you can hit various oddities with the in-page-navigation. I'm thinking this happens because it only considers an item on page if it is at the very top of the viewport or hidden.

Example screenshot: screen shot 2017-09-22 at 16 25 44

You can replicate by adding some text above content and then scrolling the page (probably quickly as I imagine the debounced events are a factor in this)

This is referenced in https://github.com/alphagov/tech-docs-template/issues/110 but before we knew that the problem was elements before the header and I felt it was better

kevindew avatar Sep 22 '17 15:09 kevindew