AjaxDropbutton.php in Entity reference actions 1.x        
                          
                  
                        
  
  
  
  
  
File
  src/Element/AjaxDropbutton.php
  
    View source  
  <?php
namespace Drupal\entity_reference_actions\Element;
use Drupal\Core\Render\Element\Dropbutton;
use Drupal\Core\Render\Element\RenderElement;
class AjaxDropbutton extends Dropbutton {
  
  public static function preRenderDropbutton($element) {
    $element = parent::preRenderDropbutton($element);
    
    foreach ($element['#links'] as &$link) {
      if (isset($link['title']['#ajax'])) {
        $link['title'] = RenderElement::preRenderAjaxForm($link['title']);
      }
    }
    return $element;
  }
}