diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-03-12 08:16:51 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-03-12 12:55:40 +0100 |
| commit | 8a1603eedaa8366ba6fb6c97bb58368ed854f2db (patch) | |
| tree | 77d6791f6961603b8eaecb7fe228a8d3c0b7b49c /addons/web/static/src/js | |
| parent | f02cd2977efa524b2acaa489bc5c114de69a8e88 (diff) | |
[FIX] web: don't scroll to top when opening a dialog
Steps to reproduce the issue: on an MD sized screen (i.e. such that
the chatter is below form views), go to a sale order in edit mode,
scroll down and click on 'Add an item', a modal opens, and the form
view behind scrolls back to the top, whereas it should keep its
scroll position.
This is because the ActionManager listens to event 'DOM UPDATED',
and when it occurs, it restores the current action's scroll
position (the main purpose is to restore the scroll position of a
previously visited action to which we return using the breadcrumbs).
When a dialog opens, this event is also triggered, but in this case
we should not restore the scroll position of the action in the
background.
Fixes #23491
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js index e72db2c3a0c..905d9c1c3b9 100644 --- a/addons/web/static/src/js/chrome/action_manager.js +++ b/addons/web/static/src/js/chrome/action_manager.js @@ -283,7 +283,8 @@ var ActionManager = Widget.extend({ // Listen to event "DOM_updated" to restore the scroll position core.bus.on('DOM_updated', this, function() { - if (this.inner_action) { + // DO NOT FORWARDPORT THIS + if (this.inner_action && !$('.dialog').length) { this.trigger_up('scrollTo', {offset: this.inner_action.getScrollTop() || 0}); } }); |
