diff --git a/packages/status-react/src/system/context-menu/context-menu.tsx b/packages/status-react/src/system/context-menu/context-menu.tsx index e3e17d3a..c621ced1 100644 --- a/packages/status-react/src/system/context-menu/context-menu.tsx +++ b/packages/status-react/src/system/context-menu/context-menu.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { cloneElement, useState } from 'react' import * as Primitive from '@radix-ui/react-context-menu' @@ -18,12 +18,14 @@ interface TriggerProps extends ContextMenuTriggerProps { const ContextMenuTrigger = (props: TriggerProps) => { const { children, ...triggerProps } = props + const [open, setOpen] = useState(false) + const [trigger, menu] = children return ( - + - {trigger} + {cloneElement(trigger, { 'data-open': open })} {menu}