From 7a5f62f59bf1d7631c7088e500a223a7b193ef6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 22 Sep 2022 08:45:50 +0000 Subject: [PATCH] [FIX] mail: make emoji picker active category from scroll more precise Before this commit, when scrolling in the emoji grid and there's still 2 rows of emojis before a category section, this category was mistakenly considered as active. This commit fixes the issue, so that the category is considered active only when the 1st visible row is in this category. Task-2992589 closes odoo/odoo#100934 X-original-commit: 5eea0b5480f1e45b0b05bedc21689d35178490b7 Signed-off-by: Louis Wicket (wil) --- addons/mail/static/src/models/emoji_grid_view.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/mail/static/src/models/emoji_grid_view.js b/addons/mail/static/src/models/emoji_grid_view.js index 89786be35ff..3c1881c622a 100644 --- a/addons/mail/static/src/models/emoji_grid_view.js +++ b/addons/mail/static/src/models/emoji_grid_view.js @@ -43,7 +43,7 @@ registerModel({ }, _onChangeScrollRecomputeCount() { for (const viewCategory of this.emojiPickerViewOwner.categories) { - const rowIndex = this.firstRenderedRowIndex + this.topBufferAmount; + const rowIndex = this.firstRenderedRowIndex; if ( viewCategory.emojiGridRowView && rowIndex >= viewCategory.emojiGridRowView.index && @@ -211,9 +211,6 @@ registerModel({ default: {}, inverse: 'emojiGridViewOwnerAsSearch', }), - topBufferAmount: attr({ - default: 2, - }), viewBlockRef: attr(), width: attr({ compute() {