Fix ContextMenuTrigger missing children

This commit is contained in:
Jamie Kyle 2024-02-07 06:47:25 -08:00 committed by GitHub
parent 5bd287e707
commit 2dd2de4d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,8 +72,17 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
const icon = getCallingIcon(type, direction, status);
return (
<>
<ContextMenuTrigger
id={props.id}
// react-contextmenu's typings are incorrect here
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ref={menuTriggerRef as any}
disable={props.isSelectMode}
// Immediately hide the context menu on outside click.
// This is a bug in react-contextmenu trying to handle touch events.
holdToDisplay={-1}
>
<div
onContextMenu={handleContextMenu}
// @ts-expect-error -- React/TS doesn't know about inert
// eslint-disable-next-line react/no-unknown-property
inert={props.isSelectMode ? '' : undefined}
@ -102,13 +111,7 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
}
/>
</div>
<ContextMenuTrigger
id={props.id}
ref={ref => {
// react-contextmenu's typings are incorrect here
menuTriggerRef.current = ref as unknown as ContextMenuTriggerType;
}}
/>
</ContextMenuTrigger>
<MessageContextMenu
i18n={i18n}
triggerId={props.id}