Closed irimescucosmin closed 3 years ago
@irimescucosmin There maybe some conflict between thead and tbody, I guess. I would look at this more precisely if you could provide a minimal repro (by forking, for example, this stackblitz demo).
Hi @dhilt
Here you are an example of how I use it. https://stackblitz.com/edit/ui-scroll-heigh-error?file=app.js You have to try a few time because not always happening.
Thanks
@irimescucosmin Well, I see the problem with negative indexes. You have limited datasource started with index 0. Datasource get
per your implementation periodically tries to fetch negative indexes when you are at the top position. The fix is to restrict indexes at the datasource.get level and cut off negative values before fetch (slice in your case):
datasource.get = (index, count, callback) => {
var last = index + count; // last index to fetch
index = Math.max(0, index); // index can't be less than o
count = last - index; // new count
...
callback(...);
}
Also, it seems reasonable to fix the minimal index value as the start index value which is 1 by default:
<div ui-scroll="item in datasource" buffer-size="5" start-index="0">
...
</div>
@dhilt thanks, you solved a big problem for me.
`