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

Fixes missing className prop passed to the Popover component #2261

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading