diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index bd2d350385b..183ce3104db 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -480,15 +480,20 @@ var FieldText = AbstractField.extend({ }, }), supportedFieldTypes: ['text'], + + /** + * In edit mode, the text widget contains a textarea. We append it in + * start() instead of _renderEdit() to keep the same textarea even + * if several _renderEdit are done. This allows to keep the cursor + * position and to autoresize only once. + * + * @override + */ start: function () { this.$el.addClass('o_list_text o_form_textarea'); this.$el.attr('id', this.idForLabel); if (this.mode === 'edit') { - // in edit mode, the widget contains a textarea. We append it in - // start() instead of _renderEdit() to keep the same textarea even - // if several _renderEdit are done. This allows to keep the cursor - // position and to autoresize only once this.$textarea = $('