Skip to content

Commit

Permalink
feat(menu): support accessible keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Jul 21, 2022
1 parent a27aa27 commit ede2772
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion components/menu/menu-item.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<template>
<li ref="wrapper" :class="className">
<li
ref="wrapper"
:class="className"
role="menuitem"
tabindex="0"
:aria-disabled="props.disabled ? 'true' : undefined"
@keydown.enter.stop="handleSelect"
>
<Tooltip
placement="right"
:theme="tooltipTheme"
Expand Down
2 changes: 1 addition & 1 deletion components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export default defineComponent({

return () => {
return (
<ul ref={wrapper} class={className.value}>
<ul ref={wrapper} class={className.value} role={'menu'} tabindex={0}>
{slots.default
? (
slots.default()
Expand Down

0 comments on commit ede2772

Please sign in to comment.