Which properties or features IgxGrid will not persist over RouteReuseStrategy?
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
- Click "Get column width" button
- Click "Bind data to IgxGrid" button
- Click "Move to Check component" button
- Click "Get column width" button
Result
Column width turns to be pixel from percent.
Expected result
Column width remains in percent.
Attachments
@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 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
If @ChronosSF could chime in?
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 Due to the performance implications of the potential fix, I think it's best if we just mark this as not supported.
@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.
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.