executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
431 stars 197 forks source link

Clicking on right sidebar entry highlights wrong item #678

Closed mvanier closed 1 year ago

mvanier commented 1 year ago

Describe the bug

context

Here is a sample page I've written using the executable book theme:

https://mvanier.github.io/test/content/Test.html.

Click on one of the entries on the right sidebar.

expectation

I expected the page view to switch to that section of the page (which occurs). I also expected that the correct section title would be highlighted (boldfaced); this does not occur.

bug

Instead, the entry one above the selected section is highlighted (boldfaced).

Reproduce the bug

  1. Go to https://mvanier.github.io/test/content/Test.html.
  2. Click on the second entry in the right sidebar ("Section 2").
  3. Notice that the first entry in the right sidebar ("Section 1") is highlighted instead.
  4. Repeat this for any other entry in the right sidebar; in every case but the last, the entry that is highlighted is one up from the entry that is clicked on.

List your environment

sphinx-build: 4.5.0
python: 3.10.1
OS: MacOS Monterey, version 12.4
Browsers tested: Firefox 109.0.1, Chrome 109.0.5414.119
Custom CSS: No
Markdown format: Restructured Text

requirements.txt file:

alabaster==0.7.13
Babel==2.11.0
beautifulsoup4==4.11.1
certifi==2022.12.7
charset-normalizer==3.0.1
docutils==0.17.1
idna==3.4
imagesize==1.4.1
Jinja2==3.1.2
MarkupSafe==2.1.1
packaging==23.0
pydata-sphinx-theme==0.8.1
Pygments==2.14.0
pytz==2022.7.1
PyYAML==6.0
requests==2.28.2
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
Sphinx==4.5.0
sphinx-book-theme==0.3.3
sphinx-copybutton==0.5.1
sphinx_design==0.3.0
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib.applehelp==1.0.3
urllib3==1.26.14
welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

mvanier commented 1 year ago

This appears to be a ScrollSpy bug/misfeature from Bootstrap: https://github.com/twbs/bootstrap/issues/36431. ScrollSpy seems to be inherently hard to do well, and I would recommend having an option to disable it. For the time being, I've disabled it visually via CSS.