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

Do row rendering in angular zone #1375

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

AsamK
Copy link
Contributor

@AsamK AsamK commented Apr 20, 2018

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
When using virtual scrolling, after scrolling down, the event listeners for the newly rendered rows are created outside of the angular zone, which breaks automatic change detection from these event listeners.

Angular Material Tooltip stop working after virtual scrolling #1321
Virtual scroll causes issues with auxilary (named) routes #1223
Can't select a row when I scroll down with a mouse #1216
Dialog not working after scrolling #1348

What is the new behavior?
The scroll event is emitted from inside an angular zone so event emitters in the row templates are run the in the same zone and change detection works automatically.

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@bwegrzyn
Copy link

bwegrzyn commented May 1, 2018

Would be nice to get this merged as this is currently breaking my entire application when scrolling in the table and clicking a row.

I've been forced to downgrade to 11.0.4 for the time being, but that has it's own set of bugs.

@deeg
Copy link
Contributor

deeg commented May 31, 2018

@amcdnl, @marjan-georgiev seems like this is causing a bunch of issues.

For me causing router links to not work once scrolling down.

I know you guys are super busy, just checking if this hasn't been merged due to no time, or if there is an issue with the fix itself.

Would like to start a discussion of other possible solutions if this won't be merged due to it having performance implications.

@marjan-georgiev
Copy link
Member

@deeg we were trying to inspect any effect on the performance this might have. Running it in the zone would trigger angular's change detection, which is essentially what we want here, but we wanted to do more tests and understand how much this will affect performance, so we don't have to go back and revert it later on.

@deeg
Copy link
Contributor

deeg commented May 31, 2018

@marjan-georgiev, thanks for the update. I'm currently doing the same and haven't seen any issue with making it run inside the zone.

I am not rendering millions of rows, but have tested it out with 1000+ rows rendered at once.

If anyone is interested to use a version with scrolling running in zone, you can replace your package.json:

"@swimlane/ngx-datatable": "semanticresearch/ngx-datatable#scroll-in-zone",

The only difference from release v13 is making scrolling happen inside zone:

https://github.com/semanticresearch/ngx-datatable/commits/scroll-in-zone

@marjan-georgiev marjan-georgiev merged commit d63064d into swimlane:master Jun 1, 2018
@marjan-georgiev
Copy link
Member

I think we're good to merge this. Thank you for the contribution!

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

Successfully merging this pull request may close these issues.

4 participants