Recheck if data still needs to be loaded?
marverix opened this issue · 4 comments
Hi,
I have this case that after fetchData there is still white space that mugen could still fill in with data, but he don't want to becasue there is no scroll yet. In smaller resolution it's working fine (scroll is there from very beggining) but in higher resolution it's stops to work. I have tried to experiment with couple combinations of params but no effects. I know that one solution would be to take bigger chunk of data, but still you will be able to find screen resolution that this chunk of data is unsufficient to fill whole white space.
Any ideas? Thanks!
P.S.
Great plugin mate!
You can put a button inside <mugen-scroll>
component to allow user to trigger fetchData
manually:
<mugen-scroll :should-handle="!loading" :handler="fetchData">
<button @click="fetchData">{{ loading ? 'Loading...' : 'Load more' }}</button>
</mugen-scroll>
Hmm I don't really feel like this is a good solution... I'm looking for some kind of automated solution here...
@egoist , @marverix : Mugen-scroll only shows what is handed to it. If this passes the visible scroll barrier, it will hook an event listener to do something once that point is reached. If the data is above the screen height however, there is nothing more to scroll until you send more data. Mugen-scroll will have done its job and rightfully so - as data goes, everything has been shown.
Suggestions include:
- Send more initial data to ensure you have enough to cover visible screen estate in height axis (y)
- Do your own JS calculations for height and call your
fetchData
function based upon the result
In short; Mugen-scroll does nothing wrong, and expects the developer to know (or research) what caveats exist when connecting data retrieval to scroll-linked events.
Ok, thanks :)