mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Test propagate contextmenu event
No long press yet
This commit is contained in:
parent
fe80215325
commit
42f9483491
1 changed files with 14 additions and 0 deletions
|
@ -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" />
|
||||
|
|
Loading…
Reference in a new issue