ngrid icon indicating copy to clipboard operation
ngrid copied to clipboard

Infinite scroll onTrigger get stuck

Open ronnetzer opened this issue 3 years ago • 4 comments

What is the expected behavior?

For regular DataSource, when the table is triggered and there's already a processing trigger, the previous trigger will be canceled and the new one will be invoked

What is the current behavior?

For InfiniteDataSource, the previous trigger is being canceled but the new one is not being invoked, which virtually causes the table to be stuck in loading mode

What are the steps to reproduce?

  • Take the infinite scroll example, add a search input that will do datasource.setFilter (make sure to register for filter custom trigger)
  • Write a single character
  • While the request is loading, write another character.

Which versions of Angular, CDK, Material, NGrid, OS, TypeScript, browsers are affected?

angular: 10.x ngrid: 2.x (last version before 3)

ronnetzer avatar Mar 29 '21 16:03 ronnetzer

I've witnesed this rarely and couldn't reproduced, now I have something solid. Thanks.

This and sticky rows/columns are urgent

shlomiassaf avatar Mar 29 '21 20:03 shlomiassaf

@ronnetzer I've assigned me and you, if you wish to tackle this, if not i'll try to make time this week or next one

shlomiassaf avatar Mar 29 '21 20:03 shlomiassaf

@shlomiassaf sure, I'll give it a try. but can you point me to the right place? I wasn't able to debug it all the way. I've reached onTrigger in infinite-scroll-datasource.context and to execute in execution-queue.ts. in execute there's this.checkOverlap. there's an overlap when you invoke setFilter multiple times (the fromRow and toRow are the same, the entire visible rows)

ronnetzer avatar Mar 30 '21 07:03 ronnetzer

Ohh, I just noticed it's 2.x

It's something I don't remember really well, I'll have to dive in.

It also has to be pushed to the relevant branch.

I'll try to play with it, if you have a repo with quick reproduction, it will be great!

Thanks

shlomiassaf avatar Mar 30 '21 19:03 shlomiassaf