Skip to content
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

Wrong context row data in TargetEventsPlugin with vScrollAuto and RouteReuseStrategy #279

Open
romgerman opened this issue Mar 21, 2023 · 0 comments

Comments

@romgerman
Copy link

What is the expected behavior?

When using rowClick row data should be of the clicked row.

What is the current behavior?

When using RouteReuseStrategy with route caching, PblNgridRowEvent event.root?.context?.row returns data of the rows around clicked row (and first time the row itself) when you return to the grid page.

What are the steps to reproduce?

Scroll a little (to ~140). Click on a row. Go back and find the row and click again (maybe multiple times). In the console you'll see that the id in the row data is different each time (and the row data)

https://stackblitz.com/edit/pebula-ngrid-starter-cd8gfz?file=src/app/components/grid-page/grid-page.component.ts

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

In my project its [email protected], [email protected], [email protected], [email protected], [email protected]. Any browser.

Is there anything else we should know?

Also reproduces with vScrollFixed
Workaround is to use click event on pbl-ngrid-row with pblNgridRowOverride directive

<pbl-ngrid-row *pblNgridRowOverride="let row" row (click)="clickRow($event, row)"></pbl-ngrid-row>
@romgerman romgerman changed the title Wrong context row data in TargetEventsPlugin with vScrollAuto and Angular Router RouteReuseStrategy Wrong context row data in TargetEventsPlugin with vScrollAuto and RouteReuseStrategy Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant