asciidoctor / asciidoctor-tabs

An extension for Asciidoctor that adds a tabs block to the AsciiDoc syntax.
MIT License
39 stars 7 forks source link

Tabs sync can cause content in view to jump #34

Closed mojavelinux closed 1 year ago

mojavelinux commented 1 year ago

If the tabs sync feature is enabled, and there are tabs blocks above the tabs block that the user is interacting with (aka the current tabs block), the current tabs block may appear to jump when selecting different tabs. This can happen when the tab panes that become active on a tab selection have a different height than the tab panes that were previously visible. This height difference can cause the current tabs block to shift and even go out of view. The tabs script should attempt to hold the current tabs block in the same position on the page so that the user does not see it shift vertically.

mojavelinux commented 1 year ago

When the scroll is adjusted, it should bypass smooth scrolling if set on the document. To do so, pass the behavior: 'instant' option to the window.scrollBy function.