fix(ui-shell): fix HeaderNavMenu accessibility, undefined context (#1079)

Fixes:

* hotfix: remove toggle accessor from HeaderNavMenu

* hotfix(ui-shell): HeaderNavMenu context is possibly undefined

* fix: apply a11y navigation menubar attributes
This commit is contained in:
metonym 2022-02-10 08:11:56 -08:00 committed by GitHub
commit 1939e4328d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 12 deletions

View file

@ -14,10 +14,6 @@
/** Obtain a reference to the HTML anchor element */
export let ref = null;
export function toggle() {
expanded = !expanded;
}
import { setContext } from "svelte";
import { writable } from "svelte/store";
import ChevronDown16 from "../../icons/ChevronDown16.svelte";
@ -52,6 +48,7 @@
/>
<li
role="none"
class:bx--header__submenu="{true}"
class:bx--header__submenu--current="{isCurrentSubmenu}"
on:click="{(e) => {
@ -69,6 +66,7 @@
>
<a
bind:this="{ref}"
role="menuitem"
tabindex="0"
aria-haspopup="menu"
aria-expanded="{expanded}"