[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.
This commit is contained in:
Vincent Schippefilt
2018-09-26 16:18:41 +02:00
parent 01abb0f254
commit fe4c3e0064
@@ -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++) {