Test propagate contextmenu event

No long press yet
pull/228/head
Lim Chee Aun 2023-09-19 00:46:14 +08:00
rodzic fe80215325
commit 42f9483491
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -286,6 +286,20 @@ function Notification({ notification, instance, reload, isStatic }) {
? `/${instance}/s/${actualStatusID}`
: `/s/${actualStatusID}`
}
onContextMenu={(e) => {
const post = e.target.querySelector('.status');
if (post) {
// Fire a custom event to open the context menu
if (e.metaKey) return;
e.preventDefault();
post.dispatchEvent(
new MouseEvent('contextmenu', {
clientX: e.clientX,
clientY: e.clientY,
}),
);
}
}}
>
{isStatic ? (
<Status status={actualStatus} size="s" />