-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fixed ConversationViewControllers collectionview from snapping upwards #5948
base: main
Are you sure you want to change the base?
Fixed ConversationViewControllers collectionview from snapping upwards #5948
Conversation
…rds upon scrolling the on screen keyboard all the way down. We need to invest a considerable amount of time to refactor all of this logic as continuing to add to it is unsustainable. Maybe we can invest time in converting ConversationViewController to SwiftUI?
@@ -149,7 +149,10 @@ extension ConversationViewController { | |||
|
|||
// This offset change will be animated by UIKit's UIView animation block | |||
// which updateContentInsets() is called within | |||
collectionView.setContentOffset(newOffset, animated: false) | |||
//Keyboard check hack. We need to invest time in cleaning all of this up. This is way too complicated for checking for offsets to move a scrollviews insets and offsets. It is not sustainable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also mark it as TODO as well :)
//Keyboard check hack. We need to invest time in cleaning all of this up. This is way too complicated for checking for offsets to move a scrollviews insets and offsets. It is not sustainable | |
// Keyboard check hack. We need to invest time in cleaning all of this up. This is way too complicated for checking for offsets to move a scrollviews insets and offsets. It is not sustainable. |
Please believe me when I say that I agree that the scroll offset logic around the keyboard is unsustainably complex. That said, I'm not sure where the magic numbers 5 and 40 came from, and I'm concerned that this will be a fragile change that'll make this more complicated or confusing to improve down the line. |
I absolutely believe you that the scroll offset for the keyboard is complex. I got 5 and 40 from the following process.
I agree with you that this is a fragile fix, and that something needs to be done. I think the juice is worth the squeeze to refactor the scroll offsets for the keyboard entirely. It will be annoying in the short term, but pay off tremendously in less development time and headaches in the long term. |
First time contributor checklist
Contributor checklist
Description
Created a workaround to prevent the collection view from snapping upwards upon scrolling the on-screen keyboard down. This
fixes #5854
. We need to invest a considerable amount of time to refactor all of this logic as continuing to add to it is unsustainable. Maybe we can invest time in converting ConversationViewController to SwiftUI?