diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-07-17 15:02:51 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-07-17 15:02:51 +0200 |
| commit | c3368bf2bbd779b1dd9e2bbc202cf85845803030 (patch) | |
| tree | 1282f019576d4e43cb2fffe6c16c2f5a7deeae49 /addons | |
| parent | 75c2845fb5414a65a7366273eda3c1234d5d43b9 (diff) | |
[FIX] use native DOM methods to programmatically set focus on an element
jQuery breaks the expected ordering of triggered consequential events
to a focusing (a blur event on the source field, a focus event on the
destination one), which in turn breaks the expectations of the
auto-saving o2m, making the o2m field attempt to auto-save immediately
after having saved a row (via the [Return] key) e.g. create a new row
in a list o2m, press [Return], the widget creates a new empty row and
immediately tries to save it resulting — depending on the view's setup
— in either an empty row being saved or a bunch of fields being marked
as invalid even though the user hasn't done anything yet.
Bypass jquery to avoid this issue.
jQuery tracker ref: http://bugs.jquery.com/ticket/12094
bzr revid: xmo@openerp.com-20120717130251-q2cjoj6rkxh0bvdq
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b090c1c18ec..98d50546c52 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1916,7 +1916,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w */ delay_focus: function($elem) { setTimeout(function() { - $elem.focus(); + $elem[0].focus(); }, 50); }, /** |
