From 47541460f52e692fc1c4e8626690243122890682 Mon Sep 17 00:00:00 2001 From: Nemael Date: Wed, 21 Sep 2022 13:03:09 +0000 Subject: [PATCH] [FIX] mail: fix emoji offset when clicking on category MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes the offset that happened when clicking on a category in the emoji picker Task-2991668 closes odoo/odoo#100769 X-original-commit: 299e74b2510b94a4dea526080d48b7563190a097 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/emoji_grid_view.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/mail/static/src/models/emoji_grid_view.js b/addons/mail/static/src/models/emoji_grid_view.js index 47ad8bc6396..89786be35ff 100644 --- a/addons/mail/static/src/models/emoji_grid_view.js +++ b/addons/mail/static/src/models/emoji_grid_view.js @@ -19,15 +19,9 @@ registerModel({ }); }, doJumpToCategorySelectedByUser() { - let categoryRowScrollPosition = Math.max( - 0, - // Index of the beginning of the category - (this.rowHeight * this.categorySelectedByUser.emojiGridRowView.index) - - - // Cancels the amount of buffer rows - (this.rowHeight * this.topBufferAmount) - ); - this.containerRef.el.scrollTo({ top: categoryRowScrollPosition }); + this.containerRef.el.scrollTo({ + top: this.rowHeight * this.categorySelectedByUser.emojiGridRowView.index, + }); this.update({ categorySelectedByUser: clear() }); }, /**