mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 23:31:19 +03:00
Fix some links not opening browser's context menu
This commit is contained in:
parent
1bf8616957
commit
ab0472de02
1 changed files with 2 additions and 2 deletions
|
@ -1085,7 +1085,7 @@ function Status({
|
|||
const { clientX, clientY } = e.touches?.[0] || e;
|
||||
// link detection copied from onContextMenu because here it works
|
||||
const link = e.target.closest('a');
|
||||
if (link && /^https?:\/\//.test(link.getAttribute('href'))) return;
|
||||
if (link && statusRef.current.contains(link)) return;
|
||||
e.preventDefault();
|
||||
setContextMenuProps({
|
||||
anchorPoint: {
|
||||
|
@ -1331,7 +1331,7 @@ function Status({
|
|||
if (e.metaKey) return;
|
||||
// console.log('context menu', e);
|
||||
const link = e.target.closest('a');
|
||||
if (link && /^https?:\/\//.test(link.getAttribute('href'))) return;
|
||||
if (link && statusRef.current.contains(link)) return;
|
||||
|
||||
// If there's selected text, don't show custom context menu
|
||||
const selection = window.getSelection?.();
|
||||
|
|
Loading…
Add table
Reference in a new issue