From 4ea0c712fe4e7ea8f4e8c41acba271c01284c5f4 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 22 Mar 2023 00:55:18 +0700 Subject: [PATCH] fix: duplicate hovered and focused background in suggested emoji --- src/styles/StyleUtils.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index d46bb94c7f43..5f15c2bf5fb0 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -824,16 +824,22 @@ function getEmojiSuggestionItemStyle( hovered, currentEmojiIndex, ) { + let backgroundColor; + + if (currentEmojiIndex === highlightedEmojiIndex) { + backgroundColor = themeColors.activeComponentBG; + } else if (hovered) { + backgroundColor = themeColors.hoverComponentBG; + } + return [ { height: rowHeight, justifyContent: 'center', }, - (currentEmojiIndex === highlightedEmojiIndex && !hovered) || hovered - ? { - backgroundColor: themeColors.highlightBG, - } - : {}, + backgroundColor ? { + backgroundColor, + } : {}, ]; }