diff --git a/src/Controller/ActionLinkController.php b/src/Controller/ActionLinkController.php index 6fa41a8347d7b38d3e66a91892a6dd18d9e63710..121329e518dca7ec2563df0cce2b6b7b46b34199 100644 --- a/src/Controller/ActionLinkController.php +++ b/src/Controller/ActionLinkController.php @@ -4,6 +4,7 @@ namespace Drupal\flag\Controller; use Drupal\Component\Utility\Html; use Drupal\Core\Ajax\AjaxResponse; +use Drupal\Core\Ajax\InvokeCommand; use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityInterface; @@ -158,6 +159,10 @@ class ActionLinkController implements ContainerInjectionInterface { $replace = new ReplaceCommand($selector, $this->renderer->renderInIsolation($link)); $response->addCommand($replace); + // Put the focus back on the link. + $focus = new InvokeCommand($selector . '>a', 'focus'); + $response->addCommand($focus); + // Push a message pulsing command onto the stack. $pulse = new ActionLinkFlashCommand($selector, $message); $response->addCommand($pulse);