-
-
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
Infinite Loading FlexTable: Dataset Of One Causes State Problem #361
Comments
This is a fantastic bug report. Thanks so much for taking the time to write a clear description and reproduction steps. 😄 I'll take a look soon. |
Hi again @SpencerCarstens! Here's an updated Gist that should hopefully be helpful to you. I added inline comments at the tricky parts, most notably here and here. I think I think this belongs to a class of things that are sometimes not intuitive but are done in the name of performance (eg "pure" I'm always interested in feedback from the community regarding ways to make things less confusing (eg better docs, better default behaviors, etc) so if you have any suggestions in this case- please let me know. I will be updating the Thanks again for the fantastic bug report and repro. 😄 |
Here's a new section in the |
Thanks for the gist and the information!! I'm looking it all over now. One thing you may want to look at is this example as it falls into the some of the pitfalls that were surfaced here. What I really liked about that example is that it only showed one loading row per data pull, so I'm going to see if I can find an elegant way to incorporate that with the guidance you have given me. It's particularly useful in my case, because the dataset that I'm working with does not give you result counts before you have them. So I would like to avoid the possibility of having 100 loading rows and then only getting 1 api result back... if that makes sense. |
Not sure I understand. Are you saying that I should update the example to make it easier to avoid some of this? (I think that's what you're saying but I'm not sure.) 😁
Ah. You could achieve the same thing with the gists we've been sharing here. I didn't know it was desired. 😄 All you would need to change is the _getRowCount () {
const { listSize, loadedRowCount, numLoadingRows } = this.state
// If we have more rows to load, or are currently loading rows, render a placeholder (unloaded row) to trigger the next batch
if (loadedRowCount < listSize) {
return loadedRowCount + 1
// If we've loaded all rows, render the full list
} else {
return listSize
}
} |
Yep! I ended up doing something similar. 😄 |
I was thinking, how would you feel about a public function on |
Hm. I'm kind of reluctant to add it because it feels to me like something that belongs in user-land. (After all, the data is being invalidated there- so it seems reasonable to me for I'd need to know more info about your particular situation I guess. I don't know why using |
Well, it does work, but not ideally. 😛 |
Why? The updated |
Fixed my issue. I had an embarrassing math typo. 😅 |
Hah! 😁 No worries. Been there, done that. |
Hey there!
I think I found a bug, or... I am just missing something obvious.
Thanks for your work on RV!
Issue
Loading a single item list into an Infinite Loading FlexTable prevents any future changes, even after a clearing of state.
My guess would be how the caching is being done, but I wasn't able to make any headway on that.
Steps
tl;dr - Once a result of a single row is loaded you can't un-stick it.
Example
Gist
❤️
The text was updated successfully, but these errors were encountered: