Skip to content

Commit

Permalink
Overlay: Set style prop correctly (#4699)
Browse files Browse the repository at this point in the history
* Overlay: accept style prop

* Create seven-cherries-serve.md
  • Loading branch information
siddharthkp committed Jun 27, 2024
1 parent 390511e commit 546803e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-cherries-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Overlay: Set `style` prop correctly
3 changes: 3 additions & 0 deletions packages/react/src/Overlay/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type StyledOverlayProps = {
visibility?: 'visible' | 'hidden'
overflow?: 'auto' | 'hidden' | 'scroll' | 'visible'
anchorSide?: AnchorSide
style?: React.CSSProperties
} & SxProp

export const heightMap = {
Expand Down Expand Up @@ -153,6 +154,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
portalContainerName,
preventFocusOnOpen,
position,
style: styleFromProps = {},
...rest
},
forwardedRef,
Expand Down Expand Up @@ -214,6 +216,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
bottom,
position,
'--styled-overlay-visibility': visibility,
...styleFromProps,
} as React.CSSProperties
}
/>
Expand Down

0 comments on commit 546803e

Please sign in to comment.