[FIX] web: on MAC, remove access keys activation interference

On MAC, some characters can only be typed using the ALT+Number that was
reserved for the menu access keys.
There is a system in place to collect the ALT+Number keys and force the
activation of the shortcut to make the experience better for all users
across all machines.

This fix remove this system that collects ALT+Number or other keys on MAC

Ticket number : 1887171
This commit is contained in:
Vincent Schippefilt
2018-09-21 10:55:38 +02:00
parent 84aea12bac
commit 9960e48e86
@@ -141,6 +141,13 @@ odoo.define('web.KeyboardNavigationMixin', function (require) {
});
this._addAccessKeyOverlays();
}
// on mac, there are a number of keys that are only accessible though the usage of
// the ALT key (like the @ sign in most keyboards)
// for them we do not facilitate the access keys, so they will need to be activated classically
// though Control + Alt + key (case sensitive), see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
if (this.BrowserDetection.isOsMac())
return;
if (keyDownEvent.altKey && !keyDownEvent.ctrlKey && keyDownEvent.key.length === 1) { // we don't want to catch the Alt key down, only the characters A to Z and number keys
var elementWithAccessKey = [];
if (keyDownEvent.keyCode >= 65 && keyDownEvent.keyCode <= 90 || keyDownEvent.keyCode >= 97 && keyDownEvent.keyCode <= 122) {