Skip to content
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

Cannot scroll to top programatically when header is sticked. #67

Open
parthadroja247 opened this issue Sep 14, 2020 · 1 comment
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@parthadroja247
Copy link

parthadroja247 commented Sep 14, 2020

My Pod Version: 3.0.1

I have a use case when one tab have scroll disabled and other one enabled.
So consider the following case:
Tab A -> Scroll Disabled
Tab B -> Scroll Enabled

Now I am in Tab B and scrolled half way and tabs are not sticked to top. Then I switch to Tab A following code works:

scrollView.setContentOffset(.zero, animated: true)

But When the header is sticked to top and I move to Tab A then I won't scroll to top.

Any fix or solution for this @Jiar

Thanks

@parthadroja247 parthadroja247 changed the title Cannot scroll to top programatically Cannot scroll to top programatically when header is sticked. Sep 14, 2020
@Jiar
Copy link
Owner

Jiar commented Oct 31, 2020

Thanks for the feedback, but this should be a special scenario. The framework does not consider the Scroll Disabled scenario in its design.

I can't immediately tell what the problem is, but the framework listens to the scroll with the scrollView‘s observe() method. I'm not sure if using setContentOffset for A's scrollView can trigger the callback to the observe method. You can debug by setting a breakpoint at the callback of the Observe method.

I hope the information I've provided will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants