Hello Drupal Team,
I wasn't able to find any other reports regarding this issue, so I assume no one noticed it yet... much to my surprise I might add. Here's the thing:
The "Prev" and "Next" links of the bootstrap carousel are not doing what they're suppossed to (i.e. cycling the items) because their default click event gets overwritten by the bootstrap-anchors functionality in themes/bootstrap/js/bootstrap.js. The issue lies with this part of the code (Line 120):
$scrollableElement.on('click.bootstrap-anchors', 'a[href*="#"]:not([data-toggle],[data-target])', function(e) {
this.scrollTo(e);
});
This basically treats any link with a hash in the "href" attribute as a page anchor and and initiates a smooth animated scroll to the referenced element. The only exception are links with the attributes "data-toggle" and "data-target". The problem: The slider navigation buttons use neither of those attributes, they use "data-slide". So in order to fix this, the code should look like this:
$scrollableElement.on('click.bootstrap-anchors', 'a[href*="#"]:not([data-toggle],[data-target],[data-slide])', function(e) {
this.scrollTo(e);
});
I hope this finds it's way into one of the next releases as soon as possible. It is quite a big issue and I have no idea how it was possible that, apparently, it has gone unnoticed until now.
Best regards,
Stefan
Comments
Comment #1
CP-Admin CreditAttribution: CP-Admin commentedComment #2
markhalliwellThe dev version has already fixed this.
Comment #3
travismark CreditAttribution: travismark commentedThanks this is the fix for the broken next/prev button! Tried it and it works
Comment #4
markhalliwellThe entire custom anchor JS is actually going to be removed in favor of this related issue.