JTAppleCalendar icon indicating copy to clipboard operation
JTAppleCalendar copied to clipboard

Calendar not scrolling to top, if contentInset top not 0

Open NataliaTs opened this issue 4 years ago • 1 comments

version: 8.0.3

Description

If calendar contentInset.top != 0, it is not scrolled to top

Steps To Reproduce

Change contentInset top value. Initially contentOffset of calendar is correct, after scrolling calendar can't be scrolled to top. In scrollViewWillEndDragging method setTargetContentOffset(0) is called and prevent further scrolling. If contentInset.top != 0, minimum contentOffset may be negative value, so setting it to 0 is wrong.

Expected Behavior

Calendar can be scrolled to top.

Additional Context

Locally I fixed this bug with patch by changing code in JTACScrollViewDelegates from this: if theCurrentContentOffset <= 0 { setTargetContentOffset(0); return } to this: if theCurrentContentOffset <= -scrollView.contentInset.top { setTargetContentOffset(-scrollView.contentInset.top); return }

NataliaTs avatar Apr 12 '21 12:04 NataliaTs

is it possible you can do a PR? i can accept and patch it.

patchthecode avatar Apr 14 '21 19:04 patchthecode