fix event propogation on links in messages

pull/920/head
Audric Ackermann 5 years ago
parent 7eab7fbcf4
commit cb18a48d50
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -67,7 +67,7 @@ export class Linkify extends React.Component<Props> {
!HAS_AT.test(url)
) {
results.push(
<a key={count++} href={url}>
<a key={count++} href={url} onClick={this.handleClick}>
{originalText}
</a>
);
@ -85,4 +85,10 @@ export class Linkify extends React.Component<Props> {
return results;
}
// disable click on <a> elements so clicking a message containing a link doesn't
// select the message.The link will still be opened in the browser.
public handleClick = (e: any) => {
e.stopPropagation();
};
}

Loading…
Cancel
Save