Skip to content

Which properties or features IgxGrid will not persist over RouteReuseStrategy? #8272

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

Closed
ymita opened this issue Oct 5, 2020 · 7 comments
Closed

Comments

@ymita
Copy link
Contributor

ymita commented Oct 5, 2020

Description

Which properties or features IgxGrid will not persist over RouteReuseStrategy? So far, scroll position and column width are not restored as same as before. If other properties or features are not restored, would you let me know?

This is related to #8145

  • igniteui-angular version: 10.1.4
  • browser: n/a

Following is an example that does not persist over RouteReuseStrategy.

Steps to reproduce

  1. Click "Get column width" button
  2. Click "Bind data to IgxGrid" button
  3. Click "Move to Check component" button
  4. Click "Get column width" button

Result

Column width turns to be pixel from percent.

Expected result

Column width remains in percent.

Attachments

igx-grid-scroll-position-20201005.zip

@simeonoff
Copy link
Collaborator

simeonoff commented Oct 21, 2020

@ymita After some extensive testing, it seems that only properties related to column width are changing. Everything else seems to work correctly and no other grid properties are being mutated. We've tested with all a flat grid, hierarchical grid, and tree grid. All grids had all features enabled and tested before changing the route. The state tree was dumped before and after returning to the grid component view. After that we've compared the state tree dumps to find no changes to the properties on the grid instances.

The column widths and scroll position are bugs/missing implementation, rather than the state not being "restored".

@ymita
Copy link
Contributor Author

ymita commented Oct 28, 2020

@simeonoff
Thank you for looking into this. Are we going to wait for the Angular to fix the root cause bug(angular/angular#27290)? Or are we going to fix these issues on our end?

I am asking this because this issue has been moved to Development. On the other hand, based on the information below, this is an issue with Angular framework and we will wait for the issue to be fixed by Angular framework.
#8145 (comment)

@simeonoff
Copy link
Collaborator

If @ChronosSF could chime in?

@ChronosSF
Copy link
Member

We only moved the research issue to development. Any development for solving this on our end is in the ice box (#8145)

Even if angular provides better hooks to let users know when something gets attached back, it's still going to be up to the developer to call, lets say grid.navigateTo(0) to reset the broken scroll state.

However, a mutation observer could solve this completely, however, it's not up to me if we should implement one as it comes with certain performance implications especially on IE . It will however let us fix all projected content issues that people have with let's say tabs as well (#8285)

@damyanpetev or @rkaraivanov, @kdinev may chime in if they want to.

@kdinev
Copy link
Member

kdinev commented Oct 28, 2020

@ChronosSF Due to the performance implications of the potential fix, I think it's best if we just mark this as not supported.

@rkaraivanov
Copy link
Member

@ChronosSF @kdinev

Well I am up for a mutation observer, because as you've said this can potentially fix a swath of content projection bugs.
Granted it will have performance implications in older browsers but the trade-off is fine IMO.

@ChronosSF
Copy link
Member

Created #8485 to implement the mutation observer.

We'll test and close #8145 when the mutation observer implementation is complete.

Closing this as the research for what is not persisted is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants