Identical ID tags added to each <li>

Created on 18 August 2024, 4 months ago
Updated 22 August 2024, 4 months ago

Problem/Motivation

I am seeing the same id="sticky-wrapper" added to the wrapping <div> of all but the first <li> in the <nav> — I don't think that is correct.

There is also a class added () and that's fine and ought to be enough.

The full HTML is shown below…

<nav>
  <ul>
    <div class="sticky-wrapper" style="height: 37.5156px;">
      <li class="toc-h1 btn btn-primary toc-active" style="width: 0px;"><a href="#toc-learn">LEARN</a></li>
    </div>
    <div id="sticky-wrapper" class="sticky-wrapper" style="height: 37.5156px;">
      <li class="toc-h1 btn btn-primary" style="width: 0px;"><a href="#toc-check">CHECK</a></li>
    </div>
    <div id="sticky-wrapper" class="sticky-wrapper" style="height: 37.5156px;">
      <li class="toc-h1 btn btn-primary" style="/* width: 0px; */"><a href="#toc-examine">EXAMINE</a></li>
    </div>
  </ul>
</nav>
🐛 Bug report
Status

Closed: cannot reproduce

Version

3.0

Component

Miscellaneous

Created by

🇬🇧United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SirClickALot
  • Status changed to Postponed: needs info 4 months ago
  • 🇫🇷France mably

    The problem is probably not related to toc_js as there is no occurence of sticky-wrapper in the module's source code for the 3.0.x-dev version.

    And the module code doesn't add div tags between ul and li tags which is invalid:

    https://caninclude.glitch.me/caninclude?child=div&parent=ul

  • 🇬🇧United Kingdom SirClickALot Somerset

    You're absolutely right of course, it was in fact the Sticky module — and my ludicrous configuration to target anything with a 'sticky' class on it — that was to blame for the crazy amount of sticky wrappers etc!

    My ToC blocks were sticking NOT by virtue of the ToC.js configuration…

    … but because of the Sticky module.

    HOWEVER, I have completely removed the Sticky module now while leaving the ToC.js sticky option for both my Toc.js blocks and neither of them sticks at the top of the page when I scroll down?

    I can confirm in the markup / module-based CSS that they appear as though they should be sticking at the top of the page which is what I am after, but the do not.

    <div id="block-bit-by-bit-toclg"
      class="toc-lg d-none d-lg-block contextual-region block block-toc-js block-toc-js-block">
    ...
      <div class="toc-js sticky is-visible" ...
    

    I have confirmed this behaviour on a clean DRupal 10 site with Olivero as the front end theme, the ToC.js block does not stick at the top of the page for me.

    Am I expecting the wrong thing here?

  • 🇫🇷France mably

    The sticky positioning behavior is applied in its scrolling parent container only.

    So your HTML must be specifically crafted for sticky behavior you want to get.

    May be you'll find so more information here: https://www.lambdatest.com/blog/css-position-sticky-tutorial/

  • Status changed to Closed: cannot reproduce 4 months ago
Production build 0.71.5 2024