client: Indicate active context menu item for screen readers

This commit is contained in:
Kenneth G. Franqueiro 2024-10-11 18:06:31 -04:00
parent 3d33ef8083
commit 4ba16364cc

View file

@ -19,12 +19,14 @@
left: style.left + 'px', left: style.left + 'px',
}" }"
tabindex="-1" tabindex="-1"
:aria-activedescendant="activeItem > -1 ? `context-menu-item-${activeItem}` : undefined"
@mouseleave="activeItem = -1" @mouseleave="activeItem = -1"
@keydown.enter.prevent="clickActiveItem" @keydown.enter.prevent="clickActiveItem"
> >
<!-- TODO: type --> <!-- TODO: type -->
<template v-for="(item, id) of (items as any)" :key="item.name"> <template v-for="(item, id) of (items as any)" :key="item.name">
<li <li
:id="`context-menu-item-${id}`"
:class="[ :class="[
'context-menu-' + item.type, 'context-menu-' + item.type,
item.class ? 'context-menu-' + item.class : null, item.class ? 'context-menu-' + item.class : null,