summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2018-08-21 16:13:33 +0200
committerSébastien Theys <seb@odoo.com>2018-08-22 11:51:30 +0200
commit289adeb63f51a9af26b8f383ba80089aa7aa6d87 (patch)
tree06b82d4b5949a305dddb3ae268de20631acbb648 /addons/web/static/src/js/fields/basic_fields.js
parent4310b11df534daecbf3ca49b01bd6fbad42d499f (diff)
[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
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js12
1 files changed, 11 insertions, 1 deletions
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
//--------------------------------------------------------------------------