Skip to content

Commit 546803e

Browse files
authored
Overlay: Set style prop correctly (#4699)
* Overlay: accept style prop * Create seven-cherries-serve.md
1 parent 390511e commit 546803e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/seven-cherries-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Overlay: Set `style` prop correctly

packages/react/src/Overlay/Overlay.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type StyledOverlayProps = {
2222
visibility?: 'visible' | 'hidden'
2323
overflow?: 'auto' | 'hidden' | 'scroll' | 'visible'
2424
anchorSide?: AnchorSide
25+
style?: React.CSSProperties
2526
} & SxProp
2627

2728
export const heightMap = {
@@ -153,6 +154,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
153154
portalContainerName,
154155
preventFocusOnOpen,
155156
position,
157+
style: styleFromProps = {},
156158
...rest
157159
},
158160
forwardedRef,
@@ -214,6 +216,7 @@ const Overlay = React.forwardRef<HTMLDivElement, OwnOverlayProps>(
214216
bottom,
215217
position,
216218
'--styled-overlay-visibility': visibility,
219+
...styleFromProps,
217220
} as React.CSSProperties
218221
}
219222
/>

0 commit comments

Comments
 (0)