Skip to content

Unable to get placement prop to work with usePopover using example from docs #4048

Answered by snowystinger
mgo-af asked this question in Q&A
Discussion options

You must be logged in to vote

No worries, it can be a bit complex to setup. What happened if that your ref to button isn't being passed through. So the positioning code doesn't know where the target is.

You just need to replace your Button code with this https://react-spectrum.adobe.com/react-aria/usePopover.html#button to match the rest of the example.
You could also do a forwardRef and rename the prop you pass to Button to be ref instead of buttonRef

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mgo-af
Comment options

Answer selected by mgo-af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants