From d5cd02fcbb3b8318dcaf4928112a2575daf2f379 Mon Sep 17 00:00:00 2001 From: Nidhi Patel Date: Fri, 10 Jul 2020 05:03:05 +0000 Subject: [PATCH] [FIX] web: Fix the skiped focus on radio Currently, when form view is opened in edit mode and if you proceed through the tab(keyboard) then focus is skiped on radio field. For Ex: in project when you procceed through the tab it will skip the visibility field radio. The issue occurs because the radio is inherited from the selection field and in selection field the focus is set on 'select' while there is no method to set the focus in radio and radio does not have 'select' element it has 'input' So in this commit, override the method getFocusableElement in radio widget and set the focus on 'input' instead of 'select'. closes odoo/odoo#52073 Taskid: 2252798 Closes: #52073 Related: odoo/upgrade#1430 Signed-off-by: Yannick Tivisse (yti) --- addons/web/static/src/js/fields/relational_fields.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 5c557dca239..f4677ac7190 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -3048,6 +3048,14 @@ var FieldRadio = FieldSelection.extend({ // Public //-------------------------------------------------------------------------- + /** + * @override + * @returns {jQuery} + */ + getFocusableElement: function () { + return this.mode === 'edit' && this.$input || this.$el; + }, + /** * @override * @returns {boolean} always true