From 07f6d71e4dd3fac7b4cacc545819430aa48823cd Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Thu, 11 Apr 2024 11:21:04 +0200 Subject: [PATCH] [FIX] website: keep track of throttled scroll event target for Chrome In Chrome, if a scroll event is not brand new, its `currentTarget` is lost. This commit makes sure that the `currentTarget` of the throttled scroll event sent to `_onScrollWebsiteAnimate` is kept separately to avoid the issue in case of throttling delay. task-3449843 closes odoo/odoo#161850 X-original-commit: 277e9f292a031ed835f4135e597c17dab2fd067d Signed-off-by: Benjamin Vray (bvr) --- addons/website/static/src/js/content/snippets.animation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 3d8fce7ca24..0cb23a38265 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -1604,7 +1604,8 @@ registry.WebsiteAnimate = publicWidget.Widget.extend({ * @param {Event} ev */ _onScrollWebsiteAnimate(ev) { - this._scrollWebsiteAnimate(ev.currentTarget); + // Note: Do not rely on ev.currentTarget which might be lost by Chrome. + this._scrollWebsiteAnimate(this.$scrollingElement[0]); }, });