-
-
Notifications
You must be signed in to change notification settings - Fork 798
A more accurate getEstimatedTotalWidth #812
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
Comments
Hi @tanin47. Thanks for the comment and the link to the diff. The code your change has deleted is there to avoid the overhead of having to eagerly measure every column or row in a large grid. (For example, let's say you have a list that's 10,000 rows long. I'm trying to avoid having to eagerly call the Your proposed change would make the initial scrollbar size accurate but come with a potentially large performance cost. The recommendation I would normally make for people in the position you've described would be to try to provide a more accurate Let me know your thoughts! |
The app estimates width of each column based on the data inside. I'l try As a side note, I use this patch with ~4M rows + ~50 columns in an electron app where it loads and queries large CSVs, and I don't experience any slowness. Thank you so much. I'll use the option you mentioned. |
Let me know if it works! |
It doesn't quite work because, if I understand correctly, If there's a way to provide: |
That's not a prop I want to add to this library. This use case kind of falls between the cracks of what I was aiming to support here. My suggestion would be to just use the function InnerElementType({ style, ...rest }) {
return (
<div
data-testid="example"
style={{
...style,
width: 100_000, // Whatever your width is
}}
{...rest}
/>
);
} |
This works. Thank you so much. |
No problem! 😌 Glad to hear it
…On Sun, Apr 27, 2025 at 5:10 PM Tanin Na Nakorn ***@***.***> wrote:
*tanin47* left a comment (bvaughn/react-window#812)
<#812 (comment)>
This works. Thank you so much.
—
Reply to this email directly, view it on GitHub
<#812 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHHHL72ORXSO463B2LKBL23VBVBAVCNFSM6AAAAAB2R6ANTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZTGY2DEMBTGA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
Hello! Thank you for writing up such a wonderful library. I've been using
VariableSizeGrid
withreact-virtualized-auto-sizer
. I know the set of columns and their widths upfront.I notice that, when there are many columns and I scroll to the right, it seems the initial scroll bar's width isn't accurate. The scroll bar's width jump to a completely new position once I scroll to the right most part.
I've found a fix for it, but I'm unable to tell why the previous code doesn't work: https://github.com/bvaughn/react-window/pull/811/files#diff-b0f813b993eaf874b282e409315e0a2348229d2f79fd9ee5fde673f5bfa127a9
With the fix, the initial scroll bar's width would be correct. When scrolling to the right most part, the scrollbar's width and its position don't jump.
If there's nothing obvious, I can build a PoC for it. I just wanted to open an issue first. Thank you.
The text was updated successfully, but these errors were encountered: