summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/core/dom.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js
index e0b0f67ef6d..4af811d41bc 100644
--- a/addons/web/static/src/js/core/dom.js
+++ b/addons/web/static/src/js/core/dom.js
@@ -518,7 +518,13 @@ var dom = {
const isTopScroll = $scrollable.is($topLevelScrollable);
function _computeScrollTop() {
- const elPosition = $scrollable[0].scrollTop + ($el.offset().top - $scrollable.offset().top);
+ let offsetTop = $el.offset().top;
+ if (el.classList.contains('d-none')) {
+ el.classList.remove('d-none');
+ offsetTop = $el.offset().top;
+ el.classList.add('d-none');
+ }
+ const elPosition = $scrollable[0].scrollTop + (offsetTop - $scrollable.offset().top);
let offset = options.forcedOffset;
if (offset === undefined) {
offset = (isTopScroll ? dom.scrollFixedOffset() : 0) + (options.extraOffset || 0);