summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets
diff options
context:
space:
mode:
authorLuis González <lgonzalez@vauxoo.com>2018-12-21 21:15:52 +0000
committerLuis González <lgonzalez@vauxoo.com>2018-12-22 22:22:14 +0000
commitc0104303c636a906df971bfcdd9dabd5e2d485b4 (patch)
tree4b78ad1cf630ae90d4bee5af45ed5d2d50436d1c /addons/web/static/src/js/widgets
parent67d3d30cf2992e3193ec6d20025da5ad2261871a (diff)
[FIX] web: Add missing aria attributes in menus
Some aria attributes were missing on menus, and are required to ensure a good compatibility with keyboard users and screen readers. To solve the above, the following attributes are included: - `aria-expanded`: this should be present in all dropdown menus. This is set on elements with class `dropdown-toggle` and `o_closed_menu`. - `role`: used to improve given information about what elements are for. It is added in the following cases: 1. Non-button elements that have the class `dropdown-menu` are set to `role="button"`. 2. Menu items that have the class `dropdown-item` are set to `role="menuitem"`. 3. Menu separators that have the class `dropdown-divider` are set to `role="separator"`. This is a continuation of baa1c515c592 closes odoo/odoo#29719
Diffstat (limited to 'addons/web/static/src/js/widgets')
-rw-r--r--addons/web/static/src/js/widgets/switch_company_menu.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/switch_company_menu.js b/addons/web/static/src/js/widgets/switch_company_menu.js
index c9498950a04..cc0f8825643 100644
--- a/addons/web/static/src/js/widgets/switch_company_menu.js
+++ b/addons/web/static/src/js/widgets/switch_company_menu.js
@@ -53,7 +53,7 @@ var SwitchCompanyMenu = Widget.extend({
} else {
a = '<span style="margin-right: 24px;"/>';
}
- companiesList += '<a href="#" class="dropdown-item" data-menu="company" data-company-id="' +
+ companiesList += '<a role="menuitem" href="#" class="dropdown-item" data-menu="company" data-company-id="' +
company[0] + '">' + a + company[1] + '</a>';
});
this.$('.dropdown-menu').html(companiesList);