From 5bc038472b45ae66ede92bd76200199b92ca9935 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Mon, 27 Apr 2020 16:19:58 -0400
Subject: [PATCH] Improve record toolbar dropdown roles.

---
 .../templates/RecordDriver/DefaultRecord/toolbar.phtml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
index daaea74f87e..591ba5e8d68 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
@@ -16,10 +16,14 @@
   <?php $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?>
   <?php if(count($exportFormats) > 0): ?>
     <li class="dropdown">
-      <a class="export-toggle dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow"><i class="fa fa-list-alt" aria-hidden="true"></i> <?=$this->transEsc('Export Record') ?></a>
-      <ul class="dropdown-menu" role="menu">
+      <a class="export-toggle dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow" aria-expanded="false" aria-controls="export-options"><i class="fa fa-list-alt" aria-hidden="true"></i> <?=$this->transEsc('Export Record') ?></a>
+      <ul class="dropdown-menu" id="export-options" role="menu">
         <?php foreach ($exportFormats as $exportFormat): ?>
-          <li role="none"><a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <?php endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" rel="nofollow" role="menuitem"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li>
+          <li role="none">
+            <a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <?php endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" rel="nofollow" role="menuitem">
+              <?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?>
+            </a>
+          </li>
         <?php endforeach; ?>
       </ul>
     </li>
-- 
GitLab