Skip to content

ActionMenu.Anchor doesn't accept id param and doesn't pass up child id either #4299

Description

@milemons

Description

I noticed that when you use ActionMenu.Anchor for an ActionMenu, there is no way to specify an Id for the button because it checks the anchor/button itself (not the children) for an id but the Anchor type doesn't include an id, unlike the Button type

Steps to reproduce

Example code:
https://github.com/github/github/blob/080953f77c52d03e8c896ec94a9f8592d0a48878/ui/packages/copilot-code-chat/CopilotChatButton.tsx#L67C11-L78C31

 <ActionMenu.Anchor>
<IconButtonWithTooltip
id="ICON_ID"
icon={TriangleDownIcon}
label="Copilot menu"
hideTooltip={open}
onSelect={() => setOpen(true)}
size="small"
sx={{...squareHeightSx, '>span': {mb: 0}, color: 'fg.muted'}}
tooltipDirection="sw"
data-testid="more-copilot-button"
/>
</ActionMenu.Anchor>

The button will have a random ID assigned and the Anchor will not accept an ID itself.

Version

current

Browser

Chrome, Safari, Firefox, Edge, iOS Safari

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions