mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
Possible event: click fix
This commit is contained in:
parent
323a2e3804
commit
67775311b8
@ -71,6 +71,27 @@ export const NitropediaView: FC<{}> = props =>
|
|||||||
return () => element.removeEventListener(MouseEventType.MOUSE_CLICK, onClick);
|
return () => element.removeEventListener(MouseEventType.MOUSE_CLICK, onClick);
|
||||||
}, [ onClick, content ]);
|
}, [ onClick, content ]);
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
const handle = (event: MouseEvent) =>
|
||||||
|
{
|
||||||
|
if(!(event.target instanceof HTMLAnchorElement)) return;
|
||||||
|
|
||||||
|
const link = event.target.href;
|
||||||
|
|
||||||
|
if(!link || !link.length) return;
|
||||||
|
|
||||||
|
NotificationUtilities.openUrl(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('click', handle);
|
||||||
|
|
||||||
|
return () =>
|
||||||
|
{
|
||||||
|
document.removeEventListener('click', handle);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
if(!content) return null;
|
if(!content) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user