[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
This commit is contained in:
Sébastien Theys
2018-08-22 11:51:30 +02:00
parent 4310b11df5
commit 289adeb63f
4 changed files with 64 additions and 3 deletions
@@ -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
//--------------------------------------------------------------------------