Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, the template for a collapsible panel titles looks like this:
<a href="#" class="panel-title fieldset-legend" data-toggle="collapse" data-target="<?php print $target; ?>"><?php print $title; ?></a>
The href="#"
causes really annoying behaviour with JS disabled/loading/broken, with the page jumping to the top of the screen on every click. The bootstrap markup examples look like this:
<a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Link with href
</a>
Comment | File | Size | Author |
---|---|---|---|
#6 | 2729181-6.patch | 1.74 KB | markhalliwell |
Comments
Comment #2
LewisNymanThe attached patch only links directly to the wrapper, as that is where the ID is coming from. It looks like we could move the id from the wrapper to the collapsible container to match the bootstrap examples but I don't know if that would cause side effects...
Comment #3
LewisNymanComment #4
markhalliwellCan't seem to find the related issue for this, but the same type of fix in the 8.x-3.x branch. Essentially, the
href
should be using the$target
variable anddata-target
should just be entirely removed. When that data attribute is provided, Bootstrap doesn't prevent the default behavior, which is why these JS lines were added and can likely be removed as well.Comment #5
markhalliwellNot the issue I was thinking of, but similar nonetheless.
Comment #6
markhalliwellComment #8
glynster CreditAttribution: glynster commentedHi @markcarver we just had to revert back to bootstrap 7.x-3.16 as all collapse panels were open by default and caused any content inside to appear blank. Any vertical tabs say in the appearance theme were broken as well.
https://cl.ly/112s2l3T3g0W
Out of the patches this seems to be the one where js was updated.
Comment #9
markhalliwell@glynster, you need to change your sub-theme's CSS, see #2634358-17: Multiple collapsible fieldsets have broken triggers in BS3.3.4.
I suppose I should create a change record for this.
Comment #10
markhalliwell@glynster, change record is here: https://www.drupal.org/node/2938332
Comment #11
glynster CreditAttribution: glynster commented@markcarver and this is why you are a rockstar at what you do and for the community - super fast and you know exactly where to go! Resolved. Tnx a million!
Comment #12
markhalliwell:D it's always great to hear that
Comment #13
markdc@markcarver Thanks for directing to the change record. It's a good reminder to replace those subtheme files after updates.