-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(tabs): preserve scroll position when switching between tabs #6812
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
Conversation
298b02b to
30812f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on Chrome, but Android was giving me a little trouble. On the devapp, I scrolled to the bottom of Tab Three under Tab Group Demo - Fixed Height example, then switched between Tab Four and Tab Three. Each time I switched to Tab Three, the scroll was a bit higher than when I had left it
@crisbeto @andrewseguin should we revisit this or close?
I think it's still a valid issue, but I haven't gotten around to finding an Android phone to test the issue that @andrewseguin mentioned.
AFAIK Chrome dev tools should mimic Android Chrome pretty well. Was it not reproducible there?
AFAIK the Chrome dev tools only resize the viewport, simulate touch events and fake the user agent.
@crisbeto Please rebase when you have a chance.
8d5aefe to
c16f8e3
Compare
Rebased.
c16f8e3 to
6e695aa
Compare
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!
6e695aa to
e67fda6
Compare
e67fda6 to
afc4f88
Compare
Hey @crisbeto - if you don't mind rebasing, we can try to get this pushed in
9521d84 to
59ea92d
Compare
It's good to go now @andrewseguin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, you can add merge ready label if you can verify that the function is not used and can be removed
src/lib/tabs/tab-body.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused
Also, do you mind adding in this example to the Material Examples? We don't currently have a good example of scrolling content in our tabs and it can be used to double-check the functionality
Preserves the scroll position when switching between tabs. Previously it was being reset to 0, because we detach and re-attach the content. Fixes angular#6722.
59ea92d to
26dd88c
Compare
Done @andrewseguin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see this being on option on the tabs rather than always doing it. @andrewseguin thoughts?
deftomat
commented
Apr 10, 2019
Any news?
(revisiting old PRs)
Keeping this one open since we still want to land it, but still lower priority than other issues.
26dd88c
Preserves the scroll position when switching between tabs. Previously it was being reset to 0, because we detach and re-attach the content.
Fixes #6722.