Empty TOC should not result in an 'empty' block

Created on 20 August 2024, 4 months ago
Updated 28 August 2024, 4 months ago

Problem/Motivation

If, according to the inclusion rules on any particular TOC.js block instance, there are no candidates then the block should not render at all.

The reason I bring this up is that I am seeing TOC.js blocks appearing when the nav is empty as seen belowโ€ฆ

<div class="toc-js sticky is-visible" id="toc-js-block" data-selectors="h1, :not(.is-a-group-title-Yes)&amp;gt;h2"
      data-selectors-minimum="0" data-container=".node" data-prefix="toc" data-list-type="ul" data-li-classes=""
      data-skip-invisible-headings="0" data-use-heading-html="0" data-back-to-top="1"
      data-back-to-top-label="BACK TO TOP" data-heading-focus="0" data-back-to-toc="0"
      data-back-to-toc-label="Back to table of contents" data-back-to-toc-classes="visually-hidden-focusable"
      data-smooth-scrolling="1" data-highlight-on-scroll="1" data-highlight-offset="100" data-sticky="1"
      data-sticky-offset="0" data-ajax-page-updates="0" data-once="toc_js" style="top: 0px;">
      <nav></nav>
    </div>

Yes, I have various other 'padding' around thet above block but I wonder when it should be ultimately up the TOC.js module to decide whehter or not to even attempt to render the block.

โœจ Feature request
Status

Closed: works as designed

Version

3.0

Component

User interface

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom SirClickALot Somerset

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

Comments & Activities

Production build 0.71.5 2024