mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(ui-shell): replace javascript:void(0) in HeaderNavMenu
Resolves an a11y "X is not a valid attribute" warning. #184
This commit is contained in:
parent
05b77afaa2
commit
ba7cb10aa3
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,8 @@
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
export let iconDescription = 'Expand/Collapse';
|
export let iconDescription = 'Expand/Collapse';
|
||||||
export let expanded = false;
|
export let expanded = false;
|
||||||
|
export let href = '/';
|
||||||
|
|
||||||
import ChevronDown16 from 'carbon-icons-svelte/lib/ChevronDown16';
|
import ChevronDown16 from 'carbon-icons-svelte/lib/ChevronDown16';
|
||||||
import { cx } from '../../../lib';
|
import { cx } from '../../../lib';
|
||||||
|
|
||||||
|
@ -31,14 +33,14 @@
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
aria-label={text}
|
aria-label={text}
|
||||||
href="javascript:void(0)"
|
{href}
|
||||||
on:keydown
|
on:keydown
|
||||||
on:keydown={({ key }) => {
|
on:keydown={({ key }) => {
|
||||||
if (key === 'Enter') {
|
if (key === 'Enter') {
|
||||||
expanded = !expanded;
|
expanded = !expanded;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:click
|
on:click|preventDefault
|
||||||
on:mouseover
|
on:mouseover
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
on:mouseleave
|
on:mouseleave
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue