-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[iOS] automaticallyAdjustKeyboardInsets not shifting scrollview content #46732
base: main
Are you sure you want to change the base?
Changes from 4 commits
6b16270
f196483
60fb645
cd12132
cbe920b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,7 @@ - (void)didMoveToWindow | |
|
||
- (void)reactUpdateResponderOffsetForScrollView:(RCTScrollViewComponentView *)scrollView | ||
{ | ||
scrollView.firstResponderFocusView = _backedTextInputView; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Respect early return. |
||
if (![self isDescendantOfView:scrollView.scrollView] || !_backedTextInputView.isFirstResponder) { | ||
// View is outside scroll view or it's not a first responder. | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,8 @@ | |
@property (nonatomic, assign) BOOL inverted; | ||
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */ | ||
@property (nonatomic, assign) CGRect firstResponderFocus; | ||
/** newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */ | ||
@property (nonatomic, weak) UIView *firstResponderFocusView; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a lot of overlap between these two fields. If we're going to be storing the focusView anyway, can we get rid of the focus rect and instead add a |
||
|
||
// NOTE: currently these event props are only declared so we can export the | ||
// event names to JS - we don't call the blocks directly because scroll events | ||
|
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.
This should respect the early return.
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.
@javache I optimized the code to only store it when the first responder is outside the scroll view.