From fe4c3e0064e01ec2ac34e629408979b1a9c9eb7c Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Wed, 26 Sep 2018 15:23:56 +0200 Subject: [PATCH] [IMP] web: do not set accesskeys on buttons with tabindex=-1 It excludes a lot of 'noise' when we do not set automatically access keys to all the skipped items, this allows a better focus on actions when using the keyboard. --- addons/web/static/src/js/chrome/keyboard_navigation_mixin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js b/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js index 6fec5795bee..a8d95d57a79 100644 --- a/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js +++ b/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js @@ -121,7 +121,10 @@ odoo.define('web.KeyboardNavigationMixin', function (require) { var usedAccessKey = this._getAllUsedAccessKeys(); - var buttonsWithoutAccessKey = this.$el.find('button.btn:visible').not('[accesskey]').not('[disabled]'); + var buttonsWithoutAccessKey = this.$el.find('button.btn:visible') + .not('[accesskey]') + .not('[disabled]') + .not('[tabindex="-1"]'); _.each(buttonsWithoutAccessKey, function (elem) { var buttonString = [elem.innerText, elem.title, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"].join(''); for (var letterIndex = 0; letterIndex < buttonString.length; letterIndex++) {