Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support controlling ActionMenu position (anchor side) #3712

Closed
iansan5653 opened this issue Sep 6, 2023 · 0 comments · Fixed by #3714
Closed

Support controlling ActionMenu position (anchor side) #3712

iansan5653 opened this issue Sep 6, 2023 · 0 comments · Fixed by #3714

Comments

@iansan5653
Copy link
Contributor

ActionMenu always renders below its anchor element, and this cannot be overridden. This would be very useful to control, particularly to be able to position submenus to the right of the anchor:

Screenshot of ActionMenu with a nested ActionMenu inside. The submenu appears below the menu item that opened it.

In the above screenshot, we'd like to render the menu to the right by default, as recommended by the Primer design guidelines.

ActionMenu.Overlay does forward unused props down to the underlying Overlay component, and Overlay does accept an anchorSide prop. This would appear to allow custom positioning, but this prop only controls the transition direction on open -- not the position.

A simple solution would be to add a side prop and forward it to the AnchoredOverlay that powers the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants