select message on click on message directly

pull/1344/head
Audric Ackermann 5 years ago
parent e83912e449
commit d6ad2a1911
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -2524,7 +2524,7 @@
getAvatar() { getAvatar() {
const url = this.getAvatarPath(); const url = this.getAvatarPath();
return url ? { url } : { url: null }; return url ? { url } : { url: null };
}, },
getNotificationIcon() { getNotificationIcon() {

@ -1109,22 +1109,6 @@ export class Message extends React.PureComponent<Props, State> {
`module-message--${direction}`, `module-message--${direction}`,
expiring ? 'module-message--expired' : null 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)} {this.renderError(isIncoming)}
{isRss || isKickedFromGroup {isRss || isKickedFromGroup
@ -1138,6 +1122,22 @@ export class Message extends React.PureComponent<Props, State> {
style={{ style={{
width: isShowingImage ? width : undefined, 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.renderAuthor()}
{this.renderQuote()} {this.renderQuote()}

Loading…
Cancel
Save