You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to have a infinite single line horizontal scrolling container, but I cannot seem to get this working with this component. Is it possible or do I need to look elsewhere?
Ok, I see, how difficult would you think it would be to implement? I have not looked at the code yet, but maybe I could try to modify it myself and perhaps make a PR if it works out ok...
This particular block of code currently assumes vertical scrolling -- uses scrollTop/yOffsets/innerHeight/top-bottom positions.
Perhaps if you created another method that would be used for a horizontal scrolling mode, then it may be something @PeachScript want to include in this component.
@PatrLind@Syn-zeta thank you, please give me some time to think about it.
For the temporary solution, you can use the extend feature to override the getCurrentDistance method and make it support calculate horizontal distance.
works great! This should be merged into the core @PeachScript
@rivajunior I think maybe it's not working for you because you didn't set the direction? I guess it was not mentioned anywhere but in order for this to work with horizontal scrolling you have to set the direction to "right" because otherwise it defaults to "bottom"
One thing however is that when using horizontal scrolling, it only works if I trigger the first call to infiniteHandler manually.. which results in some warnings in the debug console Uncaught (in promise) TypeError: Cannot read property 'loaded' of undefined but it does otherwise seem to work fine
I don't have this problem with vertical scrolling.
Did you have the same problem @PatrLind with having to trigger the first load manually? If not.. any insight on how you got around that?
Activity
a-kriya commentedon Sep 16, 2017
Yeah, that isn't currently possible with this component.
PatrLind commentedon Sep 16, 2017
Ok, I see, how difficult would you think it would be to implement? I have not looked at the code yet, but maybe I could try to modify it myself and perhaps make a PR if it works out ok...
a-kriya commentedon Sep 16, 2017
This particular block of code currently assumes vertical scrolling -- uses scrollTop/yOffsets/innerHeight/top-bottom positions.
Perhaps if you created another method that would be used for a horizontal scrolling mode, then it may be something @PeachScript want to include in this component.
PeachScript commentedon Sep 17, 2017
@PatrLind @Syn-zeta thank you, please give me some time to think about it.
For the temporary solution, you can use the extend feature to override the
getCurrentDistance
method and make it support calculate horizontal distance.PatrLind commentedon Sep 18, 2017
谢谢@PeachScript , I will give it a try :)
PatrLind commentedon Sep 18, 2017
It seems my test component I made works as I need it to.
In case anyone can make use of it, here it is (TypeScript):
Note that I needed to get the latest source code for this to work. The one I got thru npm was not extendable.
PeachScript commentedon Sep 19, 2017
Haha, @PatrLind your Chinese is excellent! Thanks for your solution!
demonmind commentedon Oct 13, 2017
@PatrLind this is something I need to use in my project too, but we do not use typescript. Do you have a JS snippet i can use?
demonmind commentedon Oct 13, 2017
I cant get the
@Component({....})
to work. Webpack fails to compilePatrLind commentedon Oct 16, 2017
@demonmind sorry for that, I made a vanilla JS version for you, but I have not tested it very well, so please give it a try:
demonmind commentedon Oct 16, 2017
Thank you! will try it and let you know
yagogak commentedon Mar 1, 2018
@PatrLind this is working !, dont forget to set props direction to right on your infinite-loading-extra component
rivajunior commentedon Aug 5, 2019
I have formated the code, but even that way, didn't work
vesper8 commentedon May 2, 2020
works great! This should be merged into the core @PeachScript
@rivajunior I think maybe it's not working for you because you didn't set the direction? I guess it was not mentioned anywhere but in order for this to work with horizontal scrolling you have to set the direction to "right" because otherwise it defaults to "bottom"
like so:
vesper8 commentedon May 2, 2020
One thing however is that when using horizontal scrolling, it only works if I trigger the first call to infiniteHandler manually.. which results in some warnings in the debug console
Uncaught (in promise) TypeError: Cannot read property 'loaded' of undefined
but it does otherwise seem to work fineI don't have this problem with vertical scrolling.
Did you have the same problem @PatrLind with having to trigger the first load manually? If not.. any insight on how you got around that?
Thanks!
joe94113 commentedon Dec 28, 2022
I use this code but it doesn't work.
I set the distance to the right, but the return value is less than 100, so the scroll loading event is always triggered.
The following is my template code, and version
vue-infinite-loading": "^2.4.5
Can someone help me? Thanks