Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6d06326

Browse files
authored
Merge pull request #6045 from matrix-org/t3chguy/fix/17318
Fix edge cases with the new add reactions prompt button
2 parents b065142 + 6e5847e commit 6d06326

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

res/css/views/messages/_ReactionsRow.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ limitations under the License.
2020

2121
.mx_ReactionsRow_addReactionButton {
2222
position: relative;
23-
display: none; // show on hover of the .mx_EventTile
23+
display: inline-block;
24+
visibility: hidden; // show on hover of the .mx_EventTile
2425
width: 24px;
2526
height: 24px;
2627
vertical-align: middle;
@@ -39,7 +40,7 @@ limitations under the License.
3940
}
4041

4142
&.mx_ReactionsRow_addReactionButton_active {
42-
display: inline-block; // keep showing whilst the context menu is shown
43+
visibility: visible; // keep showing whilst the context menu is shown
4344
}
4445

4546
&:hover, &.mx_ReactionsRow_addReactionButton_active {
@@ -51,7 +52,7 @@ limitations under the License.
5152
}
5253

5354
.mx_EventTile:hover .mx_ReactionsRow_addReactionButton {
54-
display: inline-block;
55+
visibility: visible;
5556
}
5657

5758
.mx_ReactionsRow_showAll {

src/components/views/messages/ReactionsRow.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ const ReactButton = ({ mxEvent, reactions }: IProps) => {
5050
})}
5151
title={_t("Add reaction")}
5252
onClick={openMenu}
53+
onContextMenu={e => {
54+
e.preventDefault();
55+
openMenu();
56+
}}
5357
isExpanded={menuDisplayed}
5458
inputRef={button}
5559
/>
@@ -174,6 +178,8 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
174178
/>;
175179
}).filter(item => !!item);
176180

181+
if (!items.length) return null;
182+
177183
// Show the first MAX_ITEMS if there are MAX_ITEMS + 1 or more items.
178184
// The "+ 1" ensure that the "show all" reveals something that takes up
179185
// more space than the button itself.

0 commit comments

Comments
 (0)