From bec84c10a1f683f9cc37e76d7fb354ed066508f4 Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Fri, 12 Jul 2019 09:25:16 +0000 Subject: [IMP] web: keyboard navigation between searchbar and renderer This change allows direct keyboard navigation between the current action searchbar and renderer. Focus can now be toggled using DOWN arrow when focusing the searchbar or the UP arrow when focusing the top cell/record of a kanban or a list. --- addons/web/static/src/js/views/abstract_controller.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src/js/views/abstract_controller.js') diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 07a0109e9a7..cb83301c14d 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -559,15 +559,19 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { ev.data.callback(state || {}); }, /** - * Called mainly from the control panel when the focus should be given to - * the controller + * Called either from the control panel to focus the controller + * or from the view to focus the search bar * * @private * @param {OdooEvent} ev */ _onNavigationMove: function (ev) { switch (ev.data.direction) { - case 'down' : + case 'up': + ev.stopPropagation(); + this._controlPanel.focusSearchBar(); + break; + case 'down': ev.stopPropagation(); this.giveFocus(); break; @@ -629,7 +633,6 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { _onSwitchView: function (ev) { ev.data.controllerID = this.controllerID; }, - }); return AbstractController; -- cgit v1.2.3