diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-04-04 11:14:12 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 8ad523a865089434e17906fb24b45e8cf11302db (patch) | |
| tree | 2f5fbb3723b3369a5b536197e66f64313ab21829 /addons/web/static/src/js/fields | |
| parent | c7cd6fdd4195b4bd17e2948ed45cd1dea4a4bd28 (diff) | |
[FIX] web: fix focus issue in fields x2many
Before this fix, when the user dared press 'TAB', the move_next event
was propagated from the sub one2many to the outer form renderer, and
caused the form view to try to focus another totally unrelated field.
Also, the event was sent twice, because we are in a case where a field
widget is contained in another field widget.
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/abstract_field.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index 93d7c8418e2..be271ec3d3d 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -367,6 +367,9 @@ var AbstractField = Widget.extend({ */ _onKeydown: function (event) { if (event.which === $.ui.keyCode.TAB) { + // the event needs to be stopped, to prevent other field widgets + // to retrigger a move event + event.stopPropagation(); this.trigger_up(event.shiftKey ? 'move_previous' : 'move_next'); event.preventDefault(); } |
