-
Notifications
You must be signed in to change notification settings - Fork 160
Scroll position is not persisted with RouteReuseStrategy #8145
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
Comments
@ymita , Discussed this with @rkaraivanov , and as RouteReuseStrategy is currently implemented, fixing this would require introducing yet another mutation observer of some sort. This is because angular doesn't provide hooks that would allow us to update stuff that are broken between detaches (such as the scroll position). There is an angular issue: angular/angular#27290 that suggests adding such hooks so I would like to postpone fixing this to when angular decide to improve their RouteReuseStrategy. |
@norikois For the fix of this issue, are we fine with 10.2 and later? |
@ymita @ChronosSF |
We only plan one more release for 10.1 , @kdinev , @radomirchev , should we postpone it a little bit so that this fix can get in? |
@ChronosSF We will release 10.1 until all the pending PRs to it are merged. No need to postpone a current tag, we will just continue tagging until there's deltas from the previous tag. |
I've been testing the mutation observer for a while and it seems to work, however:
If @rkaraivanov , @kdinev , @radomirchev , @ymita are fine with this caveats we can proceed with merging the PR . |
@ChronosSF
|
We do allow setting widths of columns in %, as well as mixing % and pixels. All of this works correctly. However, once you try resizing one column, all columns get pixel widths. This is because we currently don't support resizing in % . This is something that can be resolved in a feature request. We have a resize observer that fixes some stuff when a grid in % width gets resized and this observer is triggered on attach/detach because a detached container has 0 width. This observer handler functions similarly to resizing a column as these columns would change widths based on the new grid width triggering the limitation of resizing columns in % -> this turns them to px. As for the scroll restoration - we already merged the solution. You can try your original sample with the latest 10.2 version. For 10.1 I think we haven't released a version that fixes it yet, we'll have to do it next week at this point. |
Wait, we do support resize with % : #7662 This issue seems to be specific to a grid that has 100% and at some points becomes 0 width (in this case when detached). It seems that there is some additional handling for such scenarios to calculate and apply the total column width as width of the grid, which incorrectly applies that calculated px width to the original width property of a column. Which is a bug - I logged it separately here: #8555 Otherwise resizing of any combination of px,% or null widths should work as expected and should not modify the original width property measurement set by the user (if user sets 20% it will remain in % after resize). |
@ChronosSF |
Glad to hear that. Scratch my info about column widths as well. Maya already PRed a fix that resolves the detach/attach transition for it to pixels. We'll release both the scroll restoration and this fix with next week's final 10.1 patch. |
@ChronosSF CC: @norikois |
There were 3 prs - #8499, #8500, #8505 addressing the scroll position and further 3- #8556, #8559, #8560 that address the column widths. Both issues have PRs for 10.1 as discussed with @norikois . Master refers to the yet unreleased 11.0 version. There was some miscommunication regarding the 10.1 release on Monday so we didn't release a patch including the scroll position fix. We'll therefore release the fixes for both issues with next week's 10.1 patch. |
Description
IgxGrid does not persist its scroll position when the grid is reused by RouteReuseStrategy.
Steps to reproduce
Result
Both vertical and horizontal scrollbars are reset to the initial positions.
Expected result
Both vertical and horizontal scrollbars should remain the positions where these are scrolled.
Attachments
igx-grid-scroll-position.zip
The text was updated successfully, but these errors were encountered: