Skip to content

Commit

Permalink
Fixes missing className prop passed to the Popover component (#2261)
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqlol authored Sep 28, 2023
1 parent 6f1ee0b commit d6bb1bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-bobcats-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': patch
---

Fixes missing className prop passed to the Popover component
8 changes: 7 additions & 1 deletion packages/circuit-ui/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ function isDivider(action: Action): action is Divider {
type OnToggle = (open: boolean | ((prevOpen: boolean) => boolean)) => void;

export interface PopoverProps {
/**
* The class name to add to the Popover wrapper element.
* Defaults to ''.
*/
className?: string;
/**
* Determines whether the Popover is open or closed.
*/
Expand Down Expand Up @@ -168,6 +173,7 @@ export const Popover = ({
fallbackPlacements = ['top', 'right', 'left'],
component: Component,
offset,
className = '',
...props
}: PopoverProps): JSX.Element | null => {
const zIndex = useStackContext();
Expand Down Expand Up @@ -303,7 +309,7 @@ export const Popover = ({
<div
{...props}
ref={refs.setFloating}
className={clsx(classes.wrapper, isOpen && classes.open)}
className={clsx(classes.wrapper, isOpen && classes.open, className)}
// @ts-expect-error z-index can be a string
style={
isMobile
Expand Down

1 comment on commit d6bb1bb

@vercel
Copy link

@vercel vercel bot commented on d6bb1bb Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.