diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-07-01 09:29:03 +0000 |
|---|---|---|
| committer | Mohammed Shekha <msh@odoo.com> | 2019-07-05 09:41:30 +0000 |
| commit | 69ca6bd0a46e80e258db54f02bee2c03bd6bc909 (patch) | |
| tree | c58e2685f4239f6e16f924e58aab98ba71c7de2d /addons/web/static/src | |
| parent | 06c78c8dc29e5a92987787c6e4c48933c5a1bc28 (diff) | |
[IMP] web: resize textarea on notebook tab show
Before this commit: when textarea is on second tab of notebook and it has long
value then autoresize can not compute actual height of the textarea as it is in
second tab and has display: none property, it is not resized until focus comes
on it
After this commit: call DOM_updated event on notebook tab change, DOM_updated
event will call resize method again, so when tab changes resize is called and as
textarea is visible now, proper height is calculated and assigned to textarea.
task-2007558
closes odoo/odoo#34503
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/form/form_renderer.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js index 9efadaabe30..98331c9b409 100644 --- a/addons/web/static/src/js/views/form/form_renderer.js +++ b/addons/web/static/src/js/views/form/form_renderer.js @@ -16,6 +16,7 @@ var FormRenderer = BasicRenderer.extend({ 'click .o_notification_box .oe_field_translate': '_onTranslate', 'click .o_notification_box .close': '_onTranslateNotificationClose', 'click .oe_title, .o_inner_group': '_onClick', + 'shown.bs.tab a[data-toggle="tab"]': '_onNotebookTabChanged', }), custom_events: _.extend({}, BasicRenderer.prototype.custom_events, { 'navigation_move':'_onNavigationMove', @@ -1062,6 +1063,16 @@ var FormRenderer = BasicRenderer.extend({ } }, /** + * Listen to notebook tab changes and trigger a DOM_updated event such that + * widgets in the visible tab can correctly compute their dimensions (e.g. + * autoresize on field text) + * + * @private + */ + _onNotebookTabChanged: function () { + core.bus.trigger('DOM_updated'); + }, + /** * open the translation view for the current field * * @private |
