-
-
Notifications
You must be signed in to change notification settings - Fork 516
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
#BUG# initialScrollOffset
causes incorrect scrollView behavior since version 2.8.0
#658
Comments
initialScrollOffset
made a error scrollview content since 2.8.0initialScrollOffset
made a error scrollview content since 2.8.0
initialScrollOffset
made a error scrollview content since 2.8.0initialScrollOffset
made a error scrollview content since 2.8.0
initialScrollOffset
made a error scrollview content since 2.8.0initialScrollOffset
causes **incorrect scrollView behavior** since version 2.8.0
initialScrollOffset
causes **incorrect scrollView behavior** since version 2.8.0
initialScrollOffset
causes *incorrect scrollView behavior* since version 2.8.0
initialScrollOffset
causes *incorrect scrollView behavior* since version 2.8.0
initialScrollOffset
causes incorrect scrollView behavior since version 2.8.0
Thank you for your feedback. I'm trying to fix this issue on iss-658 branch. |
Hi @scenee, thanks for your work and quick response. I tested the |
I thought this problem could be reproduced this issue with the following patch for the Samples app. diff --git a/Examples/Samples/Sources/ContentViewControllers/ModalViewController.swift b/Examples/Samples/Sources/ContentViewControllers/ModalViewController.swift
index 6a870fe..5d15ac1 100644
--- a/Examples/Samples/Sources/ContentViewControllers/ModalViewController.swift
+++ b/Examples/Samples/Sources/ContentViewControllers/ModalViewController.swift
@@ -46,6 +46,7 @@ final class ModalViewController: UIViewController, FloatingPanelControllerDelega
}
@IBAction func moveToHalf(sender: UIButton) {
fpc.move(to: .half, animated: true)
+ consoleVC.textView.scrollRectToVisible(CGRect(x: 0, y: 55, width: 100, height: 100), animated: true)
}
@IBAction func moveToTip(sender: UIButton) {
fpc.move(to: .tip, animated: true)
diff --git a/FloatingPanel.xcodeproj/project.pbxproj b/FloatingPanel.xcodeproj/project.pbxproj
|
Hi @scenee, I made an independent TableView demo, and it works fine with the Once I finish my current tasks, I’ll try to extract a minimal demo with |
Description
Since version 2.8.0, the
Core
records theinitialScrollOffset
in thepanningBegan(at:)
method. However,panningBegan(at:)
is only called when the user scrolls the scrollView manually, not whensetContentOffset
is used programmatically. This causes an issue when developers try to reset thescrollView
usingsetContentOffset
while changing the floating panel state from.full
to.half
. The floating panel incorrectly uses the previously recordedinitialScrollOffset
to set the scrollView’scontentOffset
, 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
Code example that reproduces the issue
How do you display panel(s)?
How many panels do you displays?
Environment
Library version
latest
Installation method
iOS version(s)
iOS 18
Xcode version
16.0
The text was updated successfully, but these errors were encountered: