-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
scaledHeight + scaledWidth not documented - do they more than just not rounding? #96
Comments
Hey @RoystonS! This is a great bug report. I really appreciate you're sharing all of that information. So the width and height values are coming from here: react-virtualized-auto-sizer/src/AutoSizer.ts Lines 157 to 195 in 1898b07
I'm using What do you think? |
I was just investigating a bug in our app where we were getting permanent horizontal scrollbars. It boiled down to a rounding issue where we had a div which was 550.6px wide, and AutoSizer was giving a
width
of 551px. Putting a 551px-wide div into a 550.6px-wide div causes horizontal scrollbars, of course.I've seen some existing related issues:
Looking at the data coming out of AutoSizer, I see there's also a pair of 'scaled' properties (
scaledWidth
+scaledHeight
). These appear to be unrounded, which is great. However, I can't see anything in any of the AutoSizer documentation about them. The 'scaled' names suggest that they might operate differently in different DPI environments or something similar, or are they merely unrounded versions of the true size?Here's a CodeSandbox reproducing the reported values:
https://codesandbox.io/p/sandbox/t8y2r7?file=%2Fsrc%2FApp.tsx
and a screenshot showing AutoSizer running in both 400.4px and a 400.6px divs, showing how the
width
is rounded to the nearest integer:The text was updated successfully, but these errors were encountered: