From b0b74696220cd83676497429ea8e5a0f4196f144 Mon Sep 17 00:00:00 2001 From: Bruno Boi Date: Tue, 3 Aug 2021 08:43:50 +0000 Subject: [PATCH] [FIX] web: home_menu navigation conflict BEFORE: e.g. navigating with arrows in a dropdown menu when the home menu is showed conflicts (focused item changes in the same time in the dropdown and in the home menu) AFTER: the home menu will not receive keydown events that are stopped by the hotkey service. Taskid-2578926 closes odoo/odoo#73130 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/core/hotkeys/hotkey_service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/core/hotkeys/hotkey_service.js b/addons/web/static/src/core/hotkeys/hotkey_service.js index 11098ce8908..e4658be6c5a 100644 --- a/addons/web/static/src/core/hotkeys/hotkey_service.js +++ b/addons/web/static/src/core/hotkeys/hotkey_service.js @@ -145,9 +145,12 @@ export const hotkeyService = { } } - // Prevent default on event if it has been handheld. + // Only if event has been handheld. if (dispatched) { + // Purpose: prevent browser defaults event.preventDefault(); + // Purpose: stop other window keydown listeners (e.g. home menu) + event.stopImmediatePropagation(); } }