Merge pull request #852 from Bilb/fix-message-selection-only-on-message-click

fix #805 select message only onclick on it
pull/860/head
Vince 5 years ago committed by GitHub
commit f91ce45c92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1102,17 +1102,7 @@ export class Message extends React.PureComponent<Props, State> {
const enableContextMenu = !isRss && !multiSelectMode;
return (
<div
className={classNames(divClasses)}
role="button"
onClick={() => {
const selection = window.getSelection();
if (selection && selection.type === 'Range') {
return;
}
this.props.onSelectMessage();
}}
>
<div className={classNames(divClasses)}>
<ContextMenuTrigger id={rightClickTriggerId}>
{this.renderAvatar()}
<div
@ -1121,6 +1111,14 @@ export class Message extends React.PureComponent<Props, State> {
`module-message--${direction}`,
expiring ? 'module-message--expired' : null
)}
role="button"
onClick={() => {
const selection = window.getSelection();
if (selection && selection.type === 'Range') {
return;
}
this.props.onSelectMessage();
}}
>
{this.renderError(isIncoming)}
{isRss ? null : this.renderMenu(!isIncoming, triggerId)}

Loading…
Cancel
Save