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

Scrolls the window if near bottom of viewport #4

Closed
donavon-silverback opened this issue May 8, 2023 · 3 comments
Closed

Scrolls the window if near bottom of viewport #4

donavon-silverback opened this issue May 8, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@donavon-silverback
Copy link

If the menu is opened when it is near the bottom of the viewport, it scrolls the screen.

If the screen had not been scrolled, it would have been properly positioned above the element.

Screen.Recording.2023-05-08.at.12.03.04.PM.mov
@bvaughn
Copy link
Owner

bvaughn commented May 8, 2023

That's interesting. Wonder why my positioning logic didn't handle that.

@bvaughn bvaughn added the bug Something isn't working label May 8, 2023
@bvaughn bvaughn self-assigned this May 25, 2023
@bvaughn
Copy link
Owner

bvaughn commented May 25, 2023

Looking at this now. It seems that just appending the context menu to the document causes it to scroll. (I'm not explicitly telling the browser to scroll.)

Maybe this is because I'm appending it directly to the document.body ? No, this doesn't reproduce. I wonder if this si a React+Portal issue? At a glance this looks similar to reach/reach-ui#956

Edit I think this is being caused by position: absolute; replacing with position: fixed seems to "fix" the issue.

@bvaughn
Copy link
Owner

bvaughn commented May 25, 2023

Fixed via e72370f

@bvaughn bvaughn closed this as completed May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants