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 = (
|
public showContextMenu = (event: React.MouseEvent<HTMLDivElement>): void => {
|
||||||
event: React.MouseEvent<HTMLDivElement>
|
|
||||||
): void => {
|
|
||||||
const selection = window.getSelection();
|
const selection = window.getSelection();
|
||||||
if (selection && !selection.isCollapsed) {
|
if (selection && !selection.isCollapsed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (event.target instanceof HTMLAnchorElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.showMenu(event);
|
this.showMenu(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2330,7 +2331,7 @@ export class Message extends React.Component<Props, State> {
|
||||||
<div
|
<div
|
||||||
className={containerClassnames}
|
className={containerClassnames}
|
||||||
style={containerStyles}
|
style={containerStyles}
|
||||||
onContextMenu={this.showMenuIfNoSelection}
|
onContextMenu={this.showContextMenu}
|
||||||
>
|
>
|
||||||
{this.renderAuthor()}
|
{this.renderAuthor()}
|
||||||
{this.renderContents()}
|
{this.renderContents()}
|
||||||
|
|
Loading…
Reference in a new issue