-
-
Notifications
You must be signed in to change notification settings - Fork 31
Issues with inverted/top infinite load. #70
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
After a lot of testing and reviewing the code for this component, I think I found out what's causing my issues. The Is this something that needs to be fixed, or am I missing something? |
Here's my temporary fix, which proves out the issue. The first line in my infinite handler stores the target element's previous height in the local state. Just like your component does. Then, when the complete condition is met, I follow the call to the nextTick(() => {
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight - prevHeight;
}); |
I'v tried to reproduce this issue but it works just fine for me |
Your example doesn't accurately represent the problem because line 16 of App.vue will never be true in your app. The API is never ending, so it will always return 10. However, if you had a dataset of 38 items, then on the last request for data that line would be true and you would experience the issue I am reporting. |
Use the following App.vue in your stackblitz to replicate the issue. Notice how the final load causes a jump to the top.
|
Oh okay, now i see the issue. |
Do you plan to fix it? |
Any progress on this issue? |
Any updates on the issue? i got the same problem |
Same issue!!! Any update please |
Below is the code I've put together to do inverted infinite scrolling. I want the behavior to behave exactly like your demo, however, I keep running into the following issues and cannot figure out why mine is behaving different than yours.
slot
attribute is bound. It's weird. If I override a slot with a template alone, it starts at the top of the scroll element, which is wrong. If I override a slot with the attribute alone, it starts at the bottom of the scroll element, which it should. I prefer to override with a template, so in order to make it work I have to include the template and the attribute binding with an empty object as shown in the code below. This doesn't seem right.Do you see what I am doing wrong to cause these issues? Thanks!
Edit: This is partial code. I stripped out a bunch of other stuff that is unrelated to the infinite scroll stuff.
The text was updated successfully, but these errors were encountered: