diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-05-05 15:21:36 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-05-08 08:10:00 +0200 |
| commit | c04b840a45edd222c50e74d18e2d02a3dd3175cd (patch) | |
| tree | cde51a1ba7c2eb0d869b9be711e8011158fb85fd /addons/web/static/src/js/fields/basic_fields.js | |
| parent | c75680c527844b3b984fa6dfbe04b612528cd9fb (diff) | |
[FIX] web: FieldMonetary: don't loose focus after edition
... in x2many editable list views.
Field widgets can detect that they are at the origin of a
field_changed event, so that they don't re-render themselves when
they are being edited.
This didn't work for fields inside x2many list views. This wasn't
a big problem for most of the fields, because the cursor position
was automatically reset after a re-rendering, but it wasn't
working for monetary fields that empty their $el before each
re-rendering.
This rev. fixes the issue by making the field widgets inside
x2many list able to detect that they are the origin of a change,
and thus removes the now useless code that restore the cursor
position.
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index b3defa97911..fc4af105865 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -229,12 +229,7 @@ var InputField = DebouncedField.extend({ type: 'text', placeholder: this.attrs.placeholder || "", }); - // Save cursor position to restore it after updating value - var selectionStart = this.$input[0].selectionStart; - var selectionEnd = this.$input[0].selectionEnd; this.$input.val(this._formatValue(this.value)); - this.$input[0].selectionStart = selectionStart; - this.$input[0].selectionEnd = selectionEnd; return this.$input; }, /** |
