nsgov / Saltire-Theme-Drupal7

Government of Nova Scotia "Saltire" look and feel template for Drupal 7
Other
4 stars 3 forks source link

Keyboard navigation skips main navigation #26

Open genwilkerhan opened 9 years ago

genwilkerhan commented 9 years ago

Using https://agefriendly.dev.gov.ns.ca as the test site: When tabbing with the keyboard, the links in the main navigation bar after the "Age-Friendly Communities" link are skipped and focus goes immediately to the breadcrumbs. The subsequent nav tabs all have tabindex=-1 set on them. This ALSO happens with .asp Saltire pages.

jmuzz commented 8 years ago

They are supposed to be aria menus which are navigatable via the arrow keys. There's a bug in saltire where the role for the menu doesn't get set correctly for it. Here's what the function should be:

/**
 * Implements theme_menu_tree__main_menu.
 */
function saltire_menu_tree__main_menu($variables) {
  global $level;
  $class = ($level == 1) ? 'menu' : 'submenu';
  return '<ul class="'.$class.'" role="menubar">' . $variables['tree'] . '</ul>';
}

This may have undesirable results if the main menu also appears in another place such as a menu block.

genwilkerhan commented 8 years ago

Joel, please feel free to submit a pull request. We can’t get to this now.

Thanks, Geoff

From: Joel Muzzerall notifications@github.com<mailto:notifications@github.com> Reply-To: nsgov/Saltire-Theme-Drupal7 reply@reply.github.com<mailto:reply@reply.github.com> Date: Thursday, October 1, 2015 at 2:01 PM To: nsgov/Saltire-Theme-Drupal7 Saltire-Theme-Drupal7@noreply.github.com<mailto:Saltire-Theme-Drupal7@noreply.github.com> Cc: Geoff Kerson geoff.kerson@novascotia.ca<mailto:geoff.kerson@novascotia.ca> Subject: Re: [Saltire-Theme-Drupal7] Keyboard navigation skips main navigation (#26)

They are supposed to be aria menus which are navigatable via the arrow keys. There's a bug in saltire where the role for the menu doesn't get set correctly for it. Here's what the function should be:

/**

— Reply to this email directly or view it on GitHubhttps://github.com/nsgov/Saltire-Theme-Drupal7/issues/26#issuecomment-144787054.