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