Hidden sibling elements are not chunker-sections

Created on 26 April 2023, over 1 year ago
Updated 10 September 2024, 2 months ago

Problem/Motivation

JS hides all sibling elements. Some of those are not div class="chunker-section", e.g. it can be just p element that goes before the main content with chunker sections.

Steps to reproduce

1. Add a paragraph before the long HTML document
2. Once the page is saved the new paragraph will be hidden

Proposed resolution

* Apply .siblings().hide() to div class="chunker-section only (be more specific)
* https://git.drupalcode.org/project/sector_multipage/-/blob/1.x/js/multip...

Remaining tasks

Needs review

User interface changes

No

API changes

No

Data model changes

No

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇿New Zealand tatianag

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

Comments & Activities

  • Issue created by @tatianag
  • @tatianag opened merge request.
  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇳🇿New Zealand ericgsmith
    <p>Before sections</p>
    
    <h2>Lorem ipsum dolor sit amet</h2>
    
    <p>Consectetur adipiscing elit. Phasellus tincidunt luctus mi non sodales. Aliquam blandit, est eget euismod rutrum, purus ante cursus turpis, eu faucibus lacus augue id nisl. Mauris pellentesque ac felis in sodales. Curabitur placerat sagittis lacus.</p>
    

    Is rendering before the change like this:

    <p style="display: none;">Before sections</p>
    <div class="chunker-section"><h2 id="lorem-ipsum-dolor-sit-amet">Lorem ipsum dolor sit amet<a href="#lorem-ipsum-dolor-sit-amet" class="anchor">#</a></h2>
    <button class="action--print-section">Print this section</button>
    <span class="print-section-line"></span>
    
    <p>Consectetur adipiscing elit. Phasellus tincidunt luctus mi non sodales. Aliquam blandit, est eget euismod rutrum, purus ante cursus turpis, eu faucibus lacus augue id nisl. Mauris pellentesque ac felis in sodales. Curabitur placerat sagittis lacus.</p>
    
    </div>
    

    After applying the patch:

    <p>Before sections</p>
    <div class="chunker-section"><h2 id="lorem-ipsum-dolor-sit-amet">Lorem ipsum dolor sit amet<a href="#lorem-ipsum-dolor-sit-amet" class="anchor">#</a></h2>
    <button class="action--print-section">Print this section</button>
    <span class="print-section-line"></span>
    
    <p>Consectetur adipiscing elit. Phasellus tincidunt luctus mi non sodales. Aliquam blandit, est eget euismod rutrum, purus ante cursus turpis, eu faucibus lacus augue id nisl. Mauris pellentesque ac felis in sodales. Curabitur placerat sagittis lacus.</p>
    
    </div>
    

    The content before the first section is correctly displayed and remains visible as you page through the chunked content.

  • Status changed to Fixed 2 months ago
  • 🇳🇿New Zealand ericgsmith

    Was committed, released but issue not closed - just tidying up

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024