Skip to content

Commit a573e05

Browse files
committed
fixup! fixup! fixup! Fix misplaced Popover when using Floating UI (#566)
1 parent 4f3f47d commit a573e05

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/Popover/Popover.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const Popover = React.forwardRef((props, ref) => {
4646
getRootAlignmentClassName(placement, styles),
4747
)}
4848
ref={ref}
49-
style={cleanPlacementStyle(placementStyle)}
49+
style={cleanPlacementStyle(placementStyle ?? {})}
5050
>
5151
{children}
5252
<span className={styles.arrow} />

src/components/Popover/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ we recommend to involve an external library designed specifically for this
163163
purpose.
164164

165165
To position the popover, you need to provide the `placementStyle` prop with the
166-
style you want to apply to the popover. This prop is filtered and should only
167-
be used to position the popover. The allowed props are
166+
style you want to apply to the popover. This prop should only be used to
167+
position the popover. The allowed props are:
168168

169169
- `position`
170170
- `inset`
@@ -291,8 +291,8 @@ React.createElement(() => {
291291
placement={finalPlacement}
292292
placementStyle={{
293293
position: strategy,
294-
top: y,
295-
left: x,
294+
top: `${y}px`,
295+
left: `${x}px`,
296296
}}
297297
ref={floating}
298298
>

0 commit comments

Comments
 (0)