The input--button--dropdown.html.twig template file has been removed.
Note: this issue does not affect anyone that has not customized template or variant of said template in a sub-theme.
This template was originally only created to "handle" dropbutton elements that were created as actual buttons. Since the Bootstrap Framework expects actual <a> tags in the dropdown menu, this template created "faux" links that, when clicked, would attempt to "proxy click" the original button.
This, however, did not encompass the full range of JavaScript events. Furthermore, the original elements weren't always rendered properly and could cause issue when Drupal behaviors were expecting the original element to be present.
Now, these elements are full rendered, but hidden in the dropdown and a multitude of JavaScript events are proxied to the original element.
If you have customized this template, you will need to move your changes to a @BootstrapPreprocess plugin that extends from the base theme:
namespace Drupal\THEMENAME\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\BootstrapDropdown as CoreBootstrapDropdown;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "bootstrap_dropdown" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("bootstrap_dropdown")
*/
class BootstrapDropdown extends CoreBootstrapDropdown {
/**
* {@inheritdoc}
*/
protected function preprocessVariables(Variables $variables) {
parent::preprocessVariables($variables);
}
/**
* {@inheritdoc}
*/
protected function preprocessLinks(Variables $variables) {
// Let base theme do its thing.
parent::preprocessLinks($variables);
// Convert items into an Element object for easier manipulation.
$items = Element::create($variables->items);
foreach ($items->children() as $item) {
// Each item will have at a minimum a "link" child.
$item->link->addClass('my-class');
// Some items may also have an original element (likely a button).
if (isset($item->element) && $item->element->isButton()) {
$item->link->addClass('was-button');
}
}
}
}