From c0104303c636a906df971bfcdd9dabd5e2d485b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Gonz=C3=A1lez?= Date: Fri, 21 Dec 2018 21:15:52 +0000 Subject: [PATCH] [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 --- addons/web/static/src/js/core/dom.js | 2 +- .../src/js/views/search/favorites_menu.js | 3 +- .../src/js/views/search/filters_menu.js | 1 + .../src/js/views/search/groupby_menu.js | 1 + .../src/js/widgets/switch_company_menu.js | 2 +- addons/web/static/src/xml/base.xml | 32 +++++++++---------- addons/web/static/src/xml/kanban.xml | 4 +-- addons/web/static/src/xml/menu.xml | 2 +- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index 848e406c4b2..b8a5b8be3a4 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -506,7 +506,7 @@ var dom = { var $dropdownMenu = $('