mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 09:18:51 +01: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;
|
const { clientX, clientY } = e.touches?.[0] || e;
|
||||||
// link detection copied from onContextMenu because here it works
|
// link detection copied from onContextMenu because here it works
|
||||||
const link = e.target.closest('a');
|
const link = e.target.closest('a');
|
||||||
if (link && /^https?:\/\//.test(link.getAttribute('href'))) return;
|
if (link && statusRef.current.contains(link)) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setContextMenuProps({
|
setContextMenuProps({
|
||||||
anchorPoint: {
|
anchorPoint: {
|
||||||
|
@ -1331,7 +1331,7 @@ function Status({
|
||||||
if (e.metaKey) return;
|
if (e.metaKey) return;
|
||||||
// console.log('context menu', e);
|
// console.log('context menu', e);
|
||||||
const link = e.target.closest('a');
|
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
|
// If there's selected text, don't show custom context menu
|
||||||
const selection = window.getSelection?.();
|
const selection = window.getSelection?.();
|
||||||
|
|
Loading…
Reference in a new issue