-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
switching nav scrolls to the top of the page #3900
Comments
Indeed. Looks like for a brief period of time between fade out and fade in the outlet stays empty. I suspect (just a guess) something is wrong around this ng-bootstrap/src/nav/nav-outlet.ts Lines 46 to 48 in 1f466ed
and maybe this ng-bootstrap/src/nav/nav-transition.ts Lines 9 to 13 in 1f466ed
Need to investigate further |
Double reflow issue caused styles + layout calculation with tab pane hidden (without `.active`). This caused window scroll positition adjustment as if tab pane wasn't there. ``` Before: - reflow() in ngbRunTransition - add('.active') in ngbNavFadeInTransition - reflow() in ngbNavFadeInTransition - add('.show') in ngbNavFadeInTransition After: - add('.active') in NgbNavOutlet - reflow() in ngbRunTransition - add('.show') in ngbNavFadeInTransition ``` Fixes ng-bootstrap#3900
Double reflow issue caused styles + layout calculation with tab pane hidden (without `.active`). This caused window scroll positition adjustment as if tab pane wasn't there. ``` Before: - reflow() in ngbRunTransition - add('.active') in ngbNavFadeInTransition - reflow() in ngbNavFadeInTransition - add('.show') in ngbNavFadeInTransition After: - add('.active') in NgbNavOutlet - reflow() in ngbRunTransition - add('.show') in ngbNavFadeInTransition ``` Fixes ng-bootstrap#3900
Double reflow issue caused styles + layout calculation with tab pane hidden (without `.active`). This caused window scroll positition adjustment as if tab pane wasn't there. ``` Before: - reflow() in ngbRunTransition - add('.active') in ngbNavFadeInTransition - reflow() in ngbNavFadeInTransition - add('.show') in ngbNavFadeInTransition After: - add('.active') in NgbNavOutlet - reflow() in ngbRunTransition - add('.show') in ngbNavFadeInTransition ``` Fixes ng-bootstrap#3900
Double reflow issue caused styles + layout calculation with tab pane hidden (without `.active`). This caused window scroll positition adjustment as if tab pane wasn't there. ``` Before: - reflow() in ngbRunTransition - add('.active') in ngbNavFadeInTransition - reflow() in ngbNavFadeInTransition - add('.show') in ngbNavFadeInTransition After: - add('.active') in NgbNavOutlet - reflow() in ngbRunTransition - add('.show') in ngbNavFadeInTransition ``` Fixes #3900
Thanks for the fix @maxokorokov ❤️ |
In a page where there is some text at the top, not filing the whole viewport height, and a nav at the bottom, large enough for the page to scroll, if you scroll down, then switch to another tab, the browser scrolls back to the top of the page.
This happens with or without animation, and with or without destroyOnHide.
Bug description:
Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-hyx6po?file=src%2Findex.html
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 10 / 11
ng-bootstrap: 8.0.0
Bootstrap: 4.5.3
The text was updated successfully, but these errors were encountered: