-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Option to limit the number of rows/columns CellMeasurer measures #962
Comments
This is related to the performance considerations section of the docs. If we only measured some of the rows (for example) then as a user scrolled, it would be possible for newly encountered rows to have wider columns, requiring us to readjust column sizes, and producing a weird visual effect of columns shifting around as a user scrolls. This would be very disorienting. So long story short: The current functionality is there for a reason, even though I understand it has perf impacts. That being said, |
@bvaughn Thanks for the quick response I understand with the default behavior if we only measured some columns initially then more later it could result in the column/row size shifting, but in my case I want to measure a subset of cells then lock the row/column size, even if it means some cells will overflow. This type of "probabilistic" sizing is fine in my application, and much preferable to the performance implications of measuring thousands of cells up front. I poked around at Perhaps what I want is a custom |
Your use-case sounds pretty specific to me though. I'd be happy to review a PR (if you can implement it in a way that would also benefit others) but I don't think I'm interested in building that functionality myself. 😄 My original thinking with That being said, my intuition was incorrect. Looking at I wonder if something like this branch would solve the problem? Need to think about this. I may be overlooking something obvious. Edit: (For clarity.) My PR addresses an unnecessary performance cost when using |
I've pushed my branch to #969. |
I'm running into this "issue" right now (I realize it's not really an issue and is just a side effect of using dynamic widths, and also this is a 3 year old thread). Two possible solutions for anyone in a similar position though:
|
I currently have some custom code to measure column sizes based on a limited number of rows (currently 10 non-empty cells per column). This is a reasonable heuristic in our application: it's ok if some cells overflow.
I've tried porting it to use
CellMeasurer
instead, and it works ok except there are too many rows to measure all of them and have decent performance.Is there a way I could limit the number of rows used in measuring, or better yet, pick specific rows for each column to measure (i.e. non-empty ones)? If not, is this a feature you'd consider adding (I may be able to help)?
The text was updated successfully, but these errors were encountered: