Closed dudek-j closed 2 years ago
After looking into this issue further it seems like setting the grabberAreaOffset
is the intended solution to my issue. This should perhaps be added to the documentation and perhaps the maps example.
Unfortunately the second part of the bug is still there, if the pan interaction exits the grabber frame during the gesture the content offset is reset. This can fairly easily replicated in the simulator as shown in the video below.
After poking around I noticed that the contentOffset reset occurs specifically in this code fragment.
It seems like using the current scrollView offset instead of the initial one solves the issue while still stopping the scrolling as intended
I am not sure if this has any potential side effects. I created a corresponding PR.
Resolved in 2.5.2 🎉
Description
My
contentViewController
consists of aUISearchBar
placed above aUITableView
. When dragging down thecontentViewController
while holding the search bar, upon release thecontentOffset
of the tracked tableView gets reset to the top.If we instead use the grabber itself and carefully drag using that, the
contentOffset
persists correctly.I was able to mitigate this issue somehow by increasing the
surfaceView.grabberAreaOffset
to match the height of theUISearchbar
. This work if the user finger remains in the grabberArea. Unfortunately, if the users finger exists the grabberArea during the swipe (this happens if we swipe down quickly), thecontentOffset
is reset.Expected behavior
I should be able to drag the floating panel using static child elements without affecting the scroll position of the tracked scrollView.
Actual behavior
If the contentViewController contains views other than the tracked scroll view, the offset of the scroll view is reset every time we drag using one of those views.
Steps to reproduce
contentOffset
will reset to top.Additional Example
fpc.surfaceView.grabberAreaOffset = 200
( The height of the red area )contentOffset
will reset to top.Code example that reproduces the issue
How do you display panel(s)?
How many panels do you displays?
Environment
Library version
Tested on 2.0.1 and 2.5.1 Issues occur on both
Installation method
iOS version(s) 15.2
Xcode version 13.2.1