-
-
Notifications
You must be signed in to change notification settings - Fork 534
Description
Description
Since version 2.8.0, the Core records the initialScrollOffset in the panningBegan(at:) method. However, panningBegan(at:) is only called when the user scrolls the scrollView manually, not when setContentOffset is used programmatically. This causes an issue when developers try to reset the scrollView using setContentOffset while changing the floating panel state from .full to .half. The floating panel incorrectly uses the previously recorded initialScrollOffset to set the scrollView’s contentOffset, which is not the expected behavior.
Expected behavior
The Core should correctly record the contentOffset of the scrollView when setContentOffset is called programmatically.
Actual behavior
The Core only updates based on pan gesture changes and does not handle programmatic changes to the contentOffset.
Steps to reproduce
- Scroll the scrollView to the middle.
- Reset the scrollView’s contentOffset to .zero.
- Change the floating panel state to .half.
Code example that reproduces the issue
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
resetSearchBar()
panelController?.move(to: .half, animated: true, completion: nil)
scrollView?.scrollRectToVisible(CGRect(x: 0, y: 0, width: 100, height: 10), animated: true)
}How do you display panel(s)?
- Add as child view controllers
How many panels do you displays?
- 1
Environment
Library version
latest
Installation method
- CocoaPods
iOS version(s)
iOS 18
Xcode version
16.0