From 42f94834915d0e364fb3e3f817b41a958abb5f6a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 19 Sep 2023 00:46:14 +0800 Subject: [PATCH] Test propagate contextmenu event No long press yet --- src/components/notification.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/notification.jsx b/src/components/notification.jsx index e0e2e5e8..958f18cb 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -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 ? (