From d6ad2a1911ddc993e1f9dd87c5cfc56bc8f80cea Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 18 Sep 2020 11:36:47 +1000 Subject: [PATCH] select message on click on message directly --- js/models/conversations.js | 2 +- ts/components/conversation/Message.tsx | 32 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 096806d37..d340ce79f 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -2524,7 +2524,7 @@ getAvatar() { const url = this.getAvatarPath(); - return url ? { url } : { url: null }; + return url ? { url } : { url: null }; }, getNotificationIcon() { diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 510910539..73143a2b0 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1109,22 +1109,6 @@ export class Message extends React.PureComponent { `module-message--${direction}`, expiring ? 'module-message--expired' : null )} - role="button" - onClick={event => { - const selection = window.getSelection(); - // Text is being selected - if (selection && selection.type === 'Range') { - return; - } - - // User clicked on message body - const target = event.target as HTMLDivElement; - if (target.className === 'text-selectable') { - return; - } - - this.props.onSelectMessage(); - }} > {this.renderError(isIncoming)} {isRss || isKickedFromGroup @@ -1138,6 +1122,22 @@ export class Message extends React.PureComponent { style={{ width: isShowingImage ? width : undefined, }} + role="button" + onClick={event => { + const selection = window.getSelection(); + // Text is being selected + if (selection && selection.type === 'Range') { + return; + } + + // User clicked on message body + const target = event.target as HTMLDivElement; + if (target.className === 'text-selectable') { + return; + } + + this.props.onSelectMessage(); + }} > {this.renderAuthor()} {this.renderQuote()}