From 549573e24c1f0b0a4a31636732db007bfe1a11d7 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Tue, 24 Apr 2018 11:39:14 +0200 Subject: [PATCH] [FIX] web: allow standard shortcuts on firefox when navigating with the keyboard, using the ALT key is the trigger for most of the access keys. In Firefox on Linux, this prevents a number of existing shortcuts (like ALT+Left arrow for browser back). This fix allows browsers to execute those shortcuts. Note: in Firefox on linux ALT+F E V S B T H are assigned to menus and cannot be stopped, removing the keypress handler does not change anything. --- .../src/js/chrome/keyboard_navigation_mixin.js | 16 ---------------- 1 file changed, 16 deletions(-) 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 dc1b5247cb1..778f2d68498 100644 --- a/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js +++ b/addons/web/static/src/js/chrome/keyboard_navigation_mixin.js @@ -26,7 +26,6 @@ odoo.define('web.KeyboardNavigationMixin', function (require) { var KeyboardNavigationMixin = { events: { 'keydown': '_onKeyDown', - 'keypress': '_onKeyPress', 'keyup': '_onKeyUp', }, @@ -177,21 +176,6 @@ odoo.define('web.KeyboardNavigationMixin', function (require) { } } }, - /** - * hides the shortcut overlays when key press event is triggered on the ALT key - * - * @private - * @param keyPressEvent {jQueryKeyboardEvent} the keyboard event triggered - * @return {undefined|false} - */ - _onKeyPress: function (keyPressEvent) { - if ((keyPressEvent.altKey || keyPressEvent.key === 'Alt') && !keyPressEvent.ctrlKey) { - if (keyPressEvent.preventDefault) keyPressEvent.preventDefault(); else keyPressEvent.returnValue = false; - if (keyPressEvent.stopPropagation) keyPressEvent.stopPropagation(); - if (keyPressEvent.cancelBubble) keyPressEvent.cancelBubble = true; - return false; - } - }, /** * hides the shortcut overlays when keyup event is triggered on the ALT key *