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

Portaled Menu Element horizontally shifting when using browser zoom #4375

Closed
EvertLundBind opened this issue Jan 14, 2021 · 2 comments
Closed

Comments

@EvertLundBind
Copy link

Steps to reproduce:

  1. Standard implementation with portaling as per spec (https://react-select.com/advanced#portaling)
  2. Use browser zoom while menu element is visible

Expected results:

Portaled menu element will maintain its relative position

Actual results:

Portaled menu element shifts left to right depending on the browser zoom level

Screenshot of https://react-select.com/advanced#portaling displaying the issue:
W2ZyWD0

Tested on:
Chrome 87.0.4280.88

@ebonow
Copy link
Collaborator

ebonow commented Jan 14, 2021

Confirmed that this behavior exists but not sure what if anything can be done. It appears that there is no standard in place to identify if a viewport has been "zoomed"
https://css-tricks.com/can-javascript-detect-the-browsers-zoom-level/

It should also be noted that the menu "snaps" back into its expected position when the menu/option is hovered. This leads me to believe that it may be related to some other behavior that prevents the menu from staying positioned as expected:
#4336
#3533
#4159

They all share similar behavior in that the scroll position is offset from what is expected but then snaps into place once the menu is hovered. I think it may be worth consolidating these into a single use-case to better identify the root.

In this particular use-case though, I don't know what event we could even use to detect a change in zoom.

@ebonow ebonow self-assigned this Jan 14, 2021
@ebonow
Copy link
Collaborator

ebonow commented Jan 17, 2021

I reviewed #3533 a bit more and this seems to be a duplicate as the browser behavior is also noted in there. I will be closing this to consolidate the efforts to that issue.

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

2 participants