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

Prevent from scrolling "overflow". #1343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yccheok
Copy link

@yccheok yccheok commented Oct 20, 2021

Prevent from scrolling "overflow". This happens when we perform

(1) Scroll down to switch from week view to month view.
(2) Without releasing gesture, reverse scroll direction to up, to switch back week view.
(3) Once we hit week view, and continue the scroll-up action, we can observe scrolling "overflow" behavior.

or

(1) Scroll up to switch from month view to week view.
(2) Without releasing gesture, reverse scroll direction to down, to switch back month view.
(3) Once we hit month view, and continue the scroll-down action, we can observe scrolling "overflow" behavior.

Before the fix, here's the demo of unwanted behavior.

Before fix

(From week view to month view, then to week view again)

a

(From month view to week view, then to month view again)

b

After the fix

(From week view to month view, then to week view again)

3

(From month view to week view, then to month view again)

4

Prevent from scrolling "overflow". This happens when we perform

(1) Scroll down to switch from week view to month view.
(2) Without releasing gesture, reverse scroll direction to up, to switch back week view.
(3) Once we hit week view, and continue the scroll-up action, we can observe scrolling "overflow" behavior.

or

(1) Scroll up to switch from month view to week view.
(2) Without releasing gesture, reverse scroll direction to down, to switch back month view.
(3) Once we hit month view, and continue the scroll-down action, we can observe scrolling "overflow" behavior.
CGFloat y = [panGesture translationInView:panGesture.view].y;

//
// Prevent from scrolling "overflow". This happens when we perform
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice explanation 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi WenchaoD,

Thank you for looking at this issues.

The submitted patch, is intent to resolve issue "during gesture", where it causes weird UI outcome.

However, I notice there is another issue "after releasing gesture".

Please note that, the issue "after releasing gesture" already occur, even before this patch.

If you look at the animation after fix (From week view, to month view, then to week view again)

3

Even though there is no weird UI outcome "during gesture", but the logic which determines the final state after "after releasing gesture" is incorrect.

For the above use case, the final state should be week view, "after releasing gesture". Somehow, the logic in scopeTransitionDidEnd incorrectly make the final state as month view.

I am currently studying and testing the logic of the following function

- (void)scopeTransitionDidEnd:(UIPanGestureRecognizer *)panGesture

If you agree, I would like to submit another code patch, to fix on scopeTransitionDidEnd.

Thank you very much for the your wonderful library. I just start learning on your library to integrate into my project, and hopefully can provide meaningful contribution soon.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the patch on scopeTransitionDidEnd 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants