Form
Form copied to clipboard
Wrong content offset with install option `scrollToRevealFirstResponder`
Expected Behavior
scrollToRevealFirstResponder
is one of the default install options when using the methods in
UIViewController+Install.swift
. When the first responder is visible the scroll view should not change its content offset.
Current Behavior
In certain situations the content will be visible but the method will change the offset of the scroll view to a negative value resulting in empty space on the screen and layout glitch.
Steps to Reproduce
TBD - I will push a branch with a test that reproduces it
Context
Basically if the view controller is in a navigation controller the calculation of the y-position of the visible rect is not correct and if the first responder is the first view on the top of the scroll view we might think that its not fully visible which results in not necessary content offset adjustment.
- Operating Version: Reproducible on iOS 11+, works fine on iOS 10 (there is difference in the way content insets are propagated to scroll views)
Failure Logs
TBD - include a screenshot