Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ function BaseEmojiPickerMenu({headerEmojis, scrollToHeader, isFiltered, listWrap
const styles = useThemeStyles();
const {windowWidth, isSmallScreenWidth} = useWindowDimensions();

// Estimated list size should be a whole integer to avoid floating point precision errors
// More info: https://github.com/Expensify/App/issues/34522
const listWidth = isSmallScreenWidth ? Math.floor(windowWidth) : CONST.EMOJI_PICKER_SIZE.WIDTH;

const flattenListWrapperStyle = useMemo(() => StyleSheet.flatten(listWrapperStyle), [listWrapperStyle]);

return (
Expand All @@ -134,7 +138,7 @@ function BaseEmojiPickerMenu({headerEmojis, scrollToHeader, isFiltered, listWrap
ListEmptyComponent={ListEmptyComponent}
alwaysBounceVertical={alwaysBounceVertical}
estimatedItemSize={CONST.EMOJI_PICKER_ITEM_HEIGHT}
estimatedListSize={{height: flattenListWrapperStyle.height, width: isSmallScreenWidth ? windowWidth : CONST.EMOJI_PICKER_SIZE.WIDTH}}
estimatedListSize={{height: flattenListWrapperStyle.height, width: listWidth}}
contentContainerStyle={styles.ph4}
extraData={extraData}
getItemType={getItemType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}) {
listWrapperStyle={[
listStyle,
{
width: windowWidth,
width: Math.floor(windowWidth),
},
]}
ref={emojiListRef}
Expand Down