From 1cc8f40d74bc7e563715a08fe8e3e5dfdc084180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Wed, 26 Jul 2023 11:27:52 +0000 Subject: [PATCH] [FIX] mail: smooth scrolling in mobile messaging menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, scrolling inside the messaging menu in mobile was stuttering. This happens because the dropdown is in full screen, and whenever there's a scroll inside this dropdown menu, the position is recomputed from internal `usePosition()` hook of `Dropdown`. The repaint of recomputing this position is costly because of using `bottom: 0` and having images in notification items that have transparent background (e.g. chatter notifications). This commit fixes the issue by defining the height of the messaging menu dropdown in mobile without `bottom-0`. This drastically eases the repainting for fixed position. `ActivityMenu` had the exact same problem, so it is also considered in this fix. closes odoo/odoo#129859 X-original-commit: 67af0ac45dcea55f52ee7ffbc253827d665d7ac6 Signed-off-by: Matthieu Stockbauer (tsm) Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/core/common/primary_variables.scss | 4 ++++ addons/mail/static/src/core/web/activity_menu.xml | 2 +- addons/mail/static/src/core/web/messaging_menu.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/core/common/primary_variables.scss b/addons/mail/static/src/core/common/primary_variables.scss index 9a92623d913..deab760c949 100644 --- a/addons/mail/static/src/core/common/primary_variables.scss +++ b/addons/mail/static/src/core/common/primary_variables.scss @@ -29,3 +29,7 @@ $o-mail-Discuss-headerHeight: 48px !default; background: none; } } + +.o-mail-systrayFullscreenDropdownMenu { + height: calc(100% - #{$o-navbar-height} + 10px); // mobile dropdown takes 10px of navbar +} diff --git a/addons/mail/static/src/core/web/activity_menu.xml b/addons/mail/static/src/core/web/activity_menu.xml index 5217db392c5..182db02c41f 100644 --- a/addons/mail/static/src/core/web/activity_menu.xml +++ b/addons/mail/static/src/core/web/activity_menu.xml @@ -2,7 +2,7 @@ - + diff --git a/addons/mail/static/src/core/web/messaging_menu.xml b/addons/mail/static/src/core/web/messaging_menu.xml index 714507457bf..b698fb75c65 100644 --- a/addons/mail/static/src/core/web/messaging_menu.xml +++ b/addons/mail/static/src/core/web/messaging_menu.xml @@ -2,7 +2,7 @@ - +