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

MenuPopover position breaking #842

Open
Scotty813 opened this issue Sep 21, 2021 · 4 comments
Open

MenuPopover position breaking #842

Scotty813 opened this issue Sep 21, 2021 · 4 comments

Comments

@Scotty813
Copy link

Scotty813 commented Sep 21, 2021

🐛 Bug report

We have a certain case when we need to set portal to false on the MenuPopover component. However, this causes the positioning to break entirely. For example, setting portal={false} and position={positionRight} so that the menu lines does not extend past the right side of the button. It appears that the position callback is not running at all when portal is false.

Current Behavior

Screen Shot 2021-10-21 at 1 23 20 PM

Expected behavior

I would expect the dropdown to align to the right side of the menu button, not extending past it.

Reproducible example

https://codesandbox.io/s/relaxed-shadow-r5vu1?file=/src/index.js

Suggested solution(s)

Not sure, but the calculations for calculating positionRight when portal is set to false needs to change

Additional context

Your environment

Software Name(s) Version
Reach Package "@reach/menu-button": "^0.16.1" and "@reach/popover": "^0.16.0"
React 17.0.2
Browser chrome 94.0.4606.81
Assistive tech
Node 16.0.0
npm/yarn 7.10.0
Operating System macOs Big Sur 11.3.1
@indiesquidge
Copy link
Collaborator

indiesquidge commented Oct 19, 2021

@Scotty813 can you please include a reproducible example of your issue using the CodeSandbox Template that's provided in the issue template, as well as describe what you mean by the positioning "breaks entirely". Would also be nice to have the rest of the details filled in on the issue template. Thanks!

@Scotty813
Copy link
Author

Should be good to go now, let me know if you need anything else

@johnny243
Copy link

johnny243 commented Apr 22, 2022

I'm experiencing the same issue. position prop has no effect when portal is set to false.

@donovanclarke
Copy link

Was the position prop intended to only be used with the portal prop set to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants