From 04398b7853d9fcf3ad38376bac61d533943231e7 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 28 Jun 2019 14:46:57 +0100 Subject: [PATCH] Tweak limits so show all reveals more space than itself --- src/components/views/messages/ReactionsRow.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/ReactionsRow.js b/src/components/views/messages/ReactionsRow.js index f210266c66..4bae8c0ca1 100644 --- a/src/components/views/messages/ReactionsRow.js +++ b/src/components/views/messages/ReactionsRow.js @@ -138,8 +138,11 @@ export default class ReactionsRow extends React.PureComponent { />; }).filter(item => !!item); + // Show the first MAX_ITEMS if there are MAX_ITEMS + 1 or more items. + // The "+ 1" ensure that the "show all" reveals something that takes up + // more space than the button itself. let showAllLink; - if (items.length > MAX_ITEMS_WHEN_LIMITED && !showAll) { + if ((items.length > MAX_ITEMS_WHEN_LIMITED + 1) && !showAll) { items = items.slice(0, MAX_ITEMS_WHEN_LIMITED); showAllLink =