SegementSlide icon indicating copy to clipboard operation
SegementSlide copied to clipboard

Cannot scroll to top programatically when header is sticked.

Open parthadroja247 opened this issue 5 years ago β€’ 1 comments

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 avatar Sep 14 '20 18:09 parthadroja247

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.

Jiar avatar Oct 31 '20 08:10 Jiar