Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
stopPropagation in the filter sidebar of Shopware 6 does not allow nested collapsibles

The Shopware 6 sidebar has bootstrap collapsible items for the filters. As we have a lot of filter options for one property, we put them in a properties / sub-property structure and want to collapse the child items.

So we added

<span class="collapsed" aria-expanded="false" data-toggle="collapse" data-target="#element-2647292d65d44853b2b3faaaf5a9572e">
    <span class="icon icon-arrow-medium-down icon-xs">
                    <svg> [ chevron icon ] </svg>
    </span>
</span>

And have put the subitems in a div:

<div class="subelement-group collapse" id="element-2647292d65d44853b2b3faaaf5a9572e">

It is not working, and after some debugging we found, that there is an additional event listener attached to the span which should expand the subitems div.

The attached event is this:

dropdownMenu.addEventListener('click', (event) => {
   event.stopPropagation();
});

If we remove the stopProgation call, everything seems to work fine. Now we a wondering if we just just make a pull request for the Shopware core which removes this line or what could be the reason why it was added.

We also believe that there is no other way to undo the stop propagation?

EDIT

We realized that we cannot just remove the stopPropagation. It is needed in case the filter is a dropdown at the top of the page. We also tried to convert the <span> into a <button> but it still does not seem to receive the click events.

EDIT2: Something like this works for the sidebar: (after changing the span to a button)

dropdownMenu.addEventListener('click', (event) => {
    if (event.target.tagName === 'BUTTON' || event.target.closest('button') != null) {
        return;
    }
    event.stopPropagation();
});

For the top-bar it does ot work so well: The dropdown still closes when expanding.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I guess the easiest solution is to disable FilterBasePlugin._preventDropdownClose by a JavaScript overwrite in our theme, as we do not use the top-bar.

A more generic would be nice, so I am open for additional answers.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!