The PositionAnchor to use for the menu. Here's the default value for the anchor:
BELOW_CENTER_ANCHOR
TOP_RIGHT_ANCHOR
TOP_INNER_RIGHT_ANCHOR
Since there can generally only be one context menu visible at a time, this
will be defaulted to "context-menu"
instead of requiring an id like the
useMenu hook. If the default id
does not work for your use case,
it can still be overridden.
Boolean if the menu should close instead of repositioning itself if the browser window is resized.
Boolean if the menu should close if the page is scrolled. The default behavior is to just update the position of the menu relative to the menu button until it can no longer be visible within the viewport.
Boolean if the menu component should not gain focus once it has mounted.
This should really only be set to true
if the enter transition has been
disabled.
Boolean if the toggle element should no longer gain focus when the menu loses visibility.
Note: The toggle element will not gain focus if:
document.activeElement
has moved outside of the menuMenuItem
's action cause the focus to move
alreadydocument.activeElement
is an link (<a href="">
){@inheritDoc CalculateFixedPositionOptions}
Boolean if the menu should be rendered horizontally instead of vertically.
This will also update the aria-orientation
.
The label should be required for a context menu since there is no valid
"toggle" component here to inherit a label from. However, this will be
defaulted to "Context Menu"
for convenience.
Boolean if the menu is being rendered as a menuitem instead of a button.
Setting this to true
implements the
ProvidedMenuToggleProps.onKeyDown functionality.
This function will be called once the TransitionStage has been set
to "enter"
.
This function will be called once the TransitionStage has been set
to "entering"
.
This function will be called once the TransitionStage has been set
to "enter"
.
This function will be called once the TransitionStage has been set
to "exited"
.
An optional function to call if the page resizes while the menu is visible.
{@inheritDoc TransitionScrollCallback}
Unlike other menus, context menus will default to no longer allowing the page to be scrolled while visible.
An optional style object to merge with the Menu
's fixed positioning
style.
A function that can be used to get the CalculateFixedPositionOptions dynamically.
An optional custom contextmenu event handler that will be merged with the
menu visibility behavior. If this function calls event.stopPropagation()
,
the default context menu behavior will not occur.
Generated using TypeDoc
@since 5.0.0