On right-click link in message bubble, show menu to copy
This commit is contained in:
parent
df0aadc8a4
commit
9a1f722545
1 changed files with 5 additions and 4 deletions
|
@ -351,13 +351,14 @@ export class Message extends React.Component<Props, State> {
|
|||
}
|
||||
};
|
||||
|
||||
public showMenuIfNoSelection = (
|
||||
event: React.MouseEvent<HTMLDivElement>
|
||||
): void => {
|
||||
public showContextMenu = (event: React.MouseEvent<HTMLDivElement>): void => {
|
||||
const selection = window.getSelection();
|
||||
if (selection && !selection.isCollapsed) {
|
||||
return;
|
||||
}
|
||||
if (event.target instanceof HTMLAnchorElement) {
|
||||
return;
|
||||
}
|
||||
this.showMenu(event);
|
||||
};
|
||||
|
||||
|
@ -2330,7 +2331,7 @@ export class Message extends React.Component<Props, State> {
|
|||
<div
|
||||
className={containerClassnames}
|
||||
style={containerStyles}
|
||||
onContextMenu={this.showMenuIfNoSelection}
|
||||
onContextMenu={this.showContextMenu}
|
||||
>
|
||||
{this.renderAuthor()}
|
||||
{this.renderContents()}
|
||||
|
|
Loading…
Reference in a new issue