From c129ae36aae69b64fe38ca106e69ea5661f4c0f9 Mon Sep 17 00:00:00 2001 From: Jitendra Prajapati Date: Fri, 22 Jul 2016 12:19:23 +0530 Subject: [PATCH] [FIX] web: Set focus on first field when opening a modal This will improve the onbarding of project and the usability in general. Project: When creating a project a small modal opens with one or more fields, and you have to click on it just to type the project name. Usability: one many2one (and others), when clicking on "Create and Edit", the focus is set on the first field. --- addons/web/static/src/js/views/form_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/form_common.js b/addons/web/static/src/js/views/form_common.js index f869842415c..82c3bc8c4a7 100644 --- a/addons/web/static/src/js/views/form_common.js +++ b/addons/web/static/src/js/views/form_common.js @@ -930,8 +930,8 @@ var FormViewDialog = ViewDialog.extend({ var fragment = document.createDocumentFragment(); self.view_form.appendTo(fragment).then(function () { self.view_form.do_show().then(function() { - self.view_form.autofocus(); _super().$el.append(fragment); + self.view_form.autofocus(); }); }); });