radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.91k stars 831 forks source link

Disagreement on accepted props between ContextMenuContentProps type definition and documentation for React Context Menu #3208

Open buyblvd-ryan opened 2 weeks ago

buyblvd-ryan commented 2 weeks ago

Bug report

Current Behavior

Currently, the documentation for React Context Menu indicates that side, alignment, and sideOffset are configurable for Context Menu.

Code example from top of page:

<ContextMenu.Content
    className="ContextMenuContent"
    sideOffset={5}
    align="end"
>
...
</ContextMenu.Content>

Features section includes:

Customize side, alignment, offsets, collision handling.

But ContextMenuContentProps is defined as follows:

interface ContextMenuContentProps extends Omit<MenuContentProps, 'onEntryFocus' | 'side' | 'sideOffset' | 'align'> {}

Accordingly, ContextMenu.Content elements do not accept accept any of those props.

Expected behavior

These things should be in agreement.

Reproducible example

N/A

Suggested solution

Correct either the type definition or the documentation based on intended behavior. (I vote for allowing these props for maximum customization. e.g. replacing default context menu behavior on mobile with a maximally configurable menu)

Additional context

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-context-menu 2.2.2
React n/a 19.0.0-rc-7c8e5e7a-20241101
Browser n/a n/a
Assistive tech n/a n/a
Node n/a v20.18.0
npm/yarn pnpm 9.12.2
Operating System Windows 11