Bug in collapsed class on accordion title panel

Created on 22 October 2021, over 3 years ago
Updated 29 September 2024, 6 months ago

Default collapsed accordion title panel has no 'collapsed' class

Code responsible to add 'collapsed' class isn't working and small fix is needed in views-bootstrap-accordion-plugin-style.tpl.php file.

Code

    $expanded = (($loop_count == 1 && $behavior == 'first') || $behavior == 'all') ? 'true' : 'false';
    $title_classes = 'accordion-toggle';
    $title_classes .= $expanded ? '' : ' collapsed';

must be fixed because any string of 'true' or 'false' will be cast to boolean .

I would like to suggest fix for it

    $expanded = (($loop_count == 1 && $behavior == 'first') || $behavior == 'all') ? 'true' : 'false';
    $title_classes = 'accordion-toggle';
    $title_classes .= $expanded == 'true' ? '' : ' collapsed';

I use it in template of my own custom theme so patch is not needed in my case but it is worth making a patch.

πŸ› Bug report
Status

Closed: won't fix

Version

3.5

Component

Accordion

Created by

πŸ‡±πŸ‡ΉLithuania arpas

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024