react-spectrum
react-spectrum copied to clipboard
Incorrect popover placement when using css `zoom` on `body`
Provide a general summary of the issue here
Hi!
I'm trying to use zoom feature provided by css, but looks like some of the popovers that use usePopover hook are not rendered correctly - they are rendered out of bounds.
Please see a video where I reproduce the issue on react-aria docs website.
๐ค Expected Behavior?
Popovers should account for css zoom property when calculating their placement.
๐ฏ Current Behavior
Popovers are rendered outside of body when its zoomed in/out using css zoom
๐ Possible Solution
No response
๐ฆ Context
We're trying to implement a functionality to make sure that users using smaller screens are using zoomed out version of our app, and zoomed in when they are on bigger resolution. It's a workaround until we make our app more responsive.
๐ฅ๏ธ Steps to Reproduce
- Go to docs of
usePopoverhook -> https://react-spectrum.adobe.com/react-aria/usePopover.html#example - Scroll down to
Open popoverbutton - Click it to verify popover opens -> it should
- Open browser dev tools
- Select
bodyand add propertyzoom: 0.9(works everywhere except firefox) - Click again on
open popoverbutton - BUG: popover is not visible
Version
3.33.1
What browsers are you seeing the problem on?
Chrome, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
Windows 11
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response
Would be very helpful for a solution to this ๐
Any ideas on workarounds?
Are there any plans to fix this bug?
This bug would either need to be fixed https://issues.chromium.org/issues/40391865#comment9
Or every time we using any dom measurements we'd need to multiple by the zoom https://stackoverflow.com/questions/44277435/css-zoom-property-not-working-with-boundingclientrectangle
But we'd have to do that only in Chrome... so not a great solution. There are a few other suggestions which you may be able to apply on your end instead in that stackoverflow.