From d0164d834bb18f37f15a129e911f7d8e1c54b7c3 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 20 Mar 2019 10:08:44 +0000 Subject: [IMP] web,account: editable list: no more position absolute Before this rev., widgets were absolutely positioned in table cells. This cause an undesired effect with text fields, as their textarea overflowed and overlapped the next lines. With this rev., wigdets are now statically positioned, and the cells height and width don't change when switching a row to edit mode. Part of task 1915702 --- addons/web/static/src/js/fields/basic_fields.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 1c5c19ebcf8..5919f100bcc 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1112,6 +1112,7 @@ var FieldText = InputField.extend(TranslatableFieldMixin, { if (this.mode === 'edit') { this.tagName = 'textarea'; } + this.autoResizeOptions = {parent: this}; }, /** * As it it done in the start function, the autoresize is done only once. @@ -1120,7 +1121,7 @@ var FieldText = InputField.extend(TranslatableFieldMixin, { */ start: function () { if (this.mode === 'edit') { - dom.autoresize(this.$el, {parent: this}); + dom.autoresize(this.$el, this.autoResizeOptions); this.$el = this.$el.add(this._renderTranslateButton()); } @@ -1157,6 +1158,16 @@ var FieldText = InputField.extend(TranslatableFieldMixin, { }, }); +var ListFieldText = FieldText.extend({ + /** + * @override + */ + init: function () { + this._super.apply(this, arguments); + this.autoResizeOptions.min_height = 0; + }, +}); + /** * Displays a handle to modify the sequence. */ @@ -2995,6 +3006,7 @@ return { FieldPhone: FieldPhone, FieldProgressBar: FieldProgressBar, FieldText: FieldText, + ListFieldText: ListFieldText, FieldToggleBoolean: FieldToggleBoolean, HandleWidget: HandleWidget, InputField: InputField, -- cgit v1.2.3