[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) <wil@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-09-23 11:22:30 +02:00
parent 8d50b65aee
commit 7a5f62f59b
@@ -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() {