igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Which properties or features IgxGrid will not persist over RouteReuseStrategy?

Open ymita opened this issue 6 years ago • 7 comments

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 https://github.com/IgniteUI/igniteui-angular/issues/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

ymita avatar Oct 05 '20 09:10 ymita

@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".

simeonoff avatar Oct 21 '20 11:10 simeonoff

@simeonoff Thank you for looking into this. Are we going to wait for the Angular to fix the root cause bug(https://github.com/angular/angular/issues/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. https://github.com/IgniteUI/igniteui-angular/issues/8145#issuecomment-702139112

ymita avatar Oct 28 '20 02:10 ymita

If @ChronosSF could chime in?

simeonoff avatar Oct 28 '20 08:10 simeonoff

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.

ChronosSF avatar Oct 28 '20 08:10 ChronosSF

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

kdinev avatar Oct 28 '20 08:10 kdinev

@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.

rkaraivanov avatar Oct 28 '20 08:10 rkaraivanov

Created https://github.com/IgniteUI/igniteui-angular/issues/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.

ChronosSF avatar Oct 29 '20 14:10 ChronosSF