diff options
| author | Sébastien Theys <seb@odoo.com> | 2018-08-21 16:13:33 +0200 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2018-08-22 11:51:30 +0200 |
| commit | 289adeb63f51a9af26b8f383ba80089aa7aa6d87 (patch) | |
| tree | 06b82d4b5949a305dddb3ae268de20631acbb648 /addons/account/static/src/js/section_and_note_fields_backend.js | |
| parent | 4310b11df534daecbf3ca49b01bd6fbad42d499f (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/account/static/src/js/section_and_note_fields_backend.js')
| -rw-r--r-- | addons/account/static/src/js/section_and_note_fields_backend.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/account/static/src/js/section_and_note_fields_backend.js b/addons/account/static/src/js/section_and_note_fields_backend.js index 0c3039ce477..a8640fa21f1 100644 --- a/addons/account/static/src/js/section_and_note_fields_backend.js +++ b/addons/account/static/src/js/section_and_note_fields_backend.js @@ -130,6 +130,20 @@ var SectionAndNoteFieldText = InputField.extend(TranslatableFieldMixin, { } return this._super.apply(this, arguments); }, + /** + * Override to force a resize of the textarea when its value has changed + * + * @override + */ + reset: function () { + if (!this.isSection) { + var self = this; + return $.when(this._super.apply(this, arguments)).then(function () { + self.$input.trigger('change'); + }); + } + return this._super.apply(this, arguments); + }, //-------------------------------------------------------------------------- // Handlers |
