From 866527de174168ef1ffc38b04965d970ec66a9be Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 23 Aug 2022 10:37:29 +1000 Subject: [PATCH 1/2] fix: make sure a double click on the picker does not trigger reply msg --- .../MessageContentWithStatus.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx b/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx index b0439bf5e..a069e5983 100644 --- a/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx +++ b/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx @@ -30,6 +30,7 @@ type Props = { dataTestId?: string; enableReactions: boolean; }; +// tslint:disable: use-simple-attributes const StyledMessageContentContainer = styled.div<{ direction: 'left' | 'right' }>` display: flex; @@ -66,17 +67,19 @@ export const MessageContentWithStatuses = (props: Props) => { const currentSelection = window.getSelection(); const currentSelectionString = currentSelection?.toString() || undefined; - // if multiple word are selected, consider that this double click was actually NOT used to reply to - // but to select - if ( - !currentSelectionString || - currentSelectionString.length === 0 || - !currentSelectionString.includes(' ') - ) { - void replyToMessage(messageId); - currentSelection?.empty(); - e.preventDefault(); - return; + if ((e.target as any).localName !== 'em-emoji-picker') { + if ( + !currentSelectionString || + currentSelectionString.length === 0 || + !/\s/.test(currentSelectionString) + ) { + // if multiple word are selected, consider that this double click was actually NOT used to reply to + // but to select + void replyToMessage(messageId); + currentSelection?.empty(); + e.preventDefault(); + return; + } } }; From 0600416f77afd7c5c4dcb257c8c03fd8cdaf51af Mon Sep 17 00:00:00 2001 From: William Grant Date: Tue, 23 Aug 2022 16:50:49 +1000 Subject: [PATCH 2/2] fix: clearing your own reaction from the clear modal should close it --- ts/components/dialog/ReactListModal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts/components/dialog/ReactListModal.tsx b/ts/components/dialog/ReactListModal.tsx index cfb89f6af..debc9fc70 100644 --- a/ts/components/dialog/ReactListModal.tsx +++ b/ts/components/dialog/ReactListModal.tsx @@ -111,6 +111,10 @@ const ReactionSenders = (props: ReactionSendersProps) => { const handleRemoveReaction = async () => { await sendMessageReaction(messageId, currentReact); + + if (senders.length <= 1) { + dispatch(updateReactListModal(null)); + } }; return (