Skip to content

Commit

Permalink
feat: MDS-1000 add role prop for Popover.Trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
yarema184 committed Feb 19, 2024
1 parent 20eb266 commit be889fb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions workspaces/core/src/popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,20 @@ const PopoverRoot = ({
);
};

const Trigger = ({ children, ...rest }: { children?: React.ReactNode }) => {
const Trigger = ({
children,
role = 'button',
...rest
}: {
children?: React.ReactNode;
role?: string;
}) => {
const { popper } = usePopoverContext('Popover.Trigger');
return (
<HeadlessPopover.Button
as={'div'}
ref={popper?.setAnchor}
role="button"
role={role}
{...rest}
>
{children}
Expand Down

0 comments on commit be889fb

Please sign in to comment.