From 289adeb63f51a9af26b8f383ba80089aa7aa6d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 21 Aug 2018 16:13:33 +0200 Subject: [FIX] web: properly resize textarea when its value changes Before this commit, a textarea would not resize when its value changed if the event was different than "input" or "focus". This commit fixes it by also listening to the "change" event, and by triggering it at appropriate times. PR: #26430 Task: 1869469 --- addons/web/static/src/js/fields/basic_fields.js | 12 +++++++++++- 1 file changed, 11 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 fdefb2cf967..3bc6cfe4b84 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1066,7 +1066,17 @@ var FieldText = InputField.extend(TranslatableFieldMixin, { } return this._super(); }, - + /** + * Override to force a resize of the textarea when its value has changed + * + * @override + */ + reset: function () { + var self = this; + return $.when(this._super.apply(this, arguments)).then(function () { + self.$input.trigger('change'); + }); + }, //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- -- cgit v1.2.3