Skip to content

Support controlling ActionMenu position (anchor side) #3712

Closed
@iansan5653

Description

@iansan5653

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions