Add role attributes in context menus

This commit is contained in:
Max Leiter 2018-04-24 10:29:14 +03:00 committed by Pavel Djundik
parent d178ac9749
commit 012ca805c1
3 changed files with 6 additions and 3 deletions

View File

@ -99,7 +99,10 @@ module.exports = class ContextMenu {
function showContextMenu(contextMenuItems, selectedElement, event) {
const target = $(event.currentTarget);
const contextMenu = $("<ul>", {id: "context-menu"});
const contextMenu = $("<ul>", {
id: "context-menu",
role: "menu",
});
for (const item of contextMenuItems) {
if (item.check(target)) {

View File

@ -1 +1 @@
<li class="context-menu-divider" />
<li class="context-menu-divider" aria-hidden="true"></li>

View File

@ -1,3 +1,3 @@
<li class="context-menu-item context-menu-{{class}}" data-action="{{action}}"{{#if data}} data-data="{{data}}"{{/if}} tabindex="0">
<li class="context-menu-item context-menu-{{class}}" data-action="{{action}}"{{#if data}} data-data="{{data}}"{{/if}} tabindex="0" role="menuitem">
{{text}}
</li>