MCPcopy Create free account
hub / github.com/adobe/react-spectrum / SubmenuTrigger

Function SubmenuTrigger

packages/@react-spectrum/s2/src/Menu.tsx:1045–1058  ·  view source on GitHub ↗
(props: SubmenuTriggerProps)

Source from the content-addressed store, hash-verified

1043export interface SubmenuTriggerProps extends Omit<AriaSubmenuTriggerProps, 'delay'> {}
1044
1045function SubmenuTrigger(props: SubmenuTriggerProps): JSX.Element {
1046 // For submenus, the offset from the edge of the popover should be 10px.
1047 // Subtract 8px for the padding around the parent menu.
1048 // Offset by padding + border so that the first item in a submenu lines up with the parent menu item.
1049 return (
1050 <AriaSubmenuTrigger {...props}>
1051 {props.children[0]}
1052 <PopoverContext.Provider
1053 value={{hideArrow: true, offset: -2, crossOffset: -8, placement: 'end top'}}>
1054 {props.children[1]}
1055 </PopoverContext.Provider>
1056 </AriaSubmenuTrigger>
1057 );
1058}
1059
1060export interface UnavailableMenuItemTriggerProps {
1061 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected