Message selection correction

pull/1002/head
Vincent 5 years ago
parent c27dd095fc
commit 6135f4d334

@ -1116,7 +1116,7 @@ export class Message extends React.PureComponent<Props, State> {
expiring ? 'module-message--expired' : null expiring ? 'module-message--expired' : null
)} )}
role="button" role="button"
onClick={e => { onClick={event => {
const selection = window.getSelection(); const selection = window.getSelection();
// Text is being selected // Text is being selected
if (selection && selection.type === 'Range') { if (selection && selection.type === 'Range') {
@ -1124,12 +1124,8 @@ export class Message extends React.PureComponent<Props, State> {
} }
// User clicked on message body // User clicked on message body
// if (e.target === 'span.text-selectable'){ const target = (event.target as HTMLDivElement);
if(target.className === 'text-selectable') return;
// }
console.log(`[event] EVENT: `, e);
console.log(`[event] Target: `, e.target);
console.log(`[event] Tagname: `, e.target);
this.props.onSelectMessage(); this.props.onSelectMessage();
}} }}

Loading…
Cancel
Save