Skip to content

Commit

Permalink
add scrollTo metadata RCTBackedTextInputViewProtocol
Browse files Browse the repository at this point in the history
Summary:
fixing oncall issue: https://fb.workplace.com/groups/rn.support/permalink/7241260632589156/

in this diff, we add the properties to the native views that are needed for the `onScroll` event.

`UITextField` is not a `UIScrollView` unlike `UITextView`, so we need to add these dummy properties

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D32523147

fbshipit-source-id: 1d4f227f498fa1c333e2d6c457484b559ca18f7e
  • Loading branch information
philIip authored and facebook-github-bot committed Nov 19, 2021
1 parent 2dd33b1 commit b735cdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) UITextFieldViewMode clearButtonMode;
@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID;
@property (nonatomic, assign, readonly) CGFloat zoomScale;
@property (nonatomic, assign, readonly) CGPoint contentOffset;
@property (nonatomic, assign, readonly) UIEdgeInsets contentInset;


// This protocol disallows direct access to `selectedTextRange` property because
// unwise usage of it can break the `delegate` behavior. So, we always have to
Expand Down
3 changes: 3 additions & 0 deletions Libraries/Text/TextInput/Singleline/RCTUITextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign, getter=isEditable) BOOL editable;
@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID;
@property (nonatomic, assign, readonly) CGFloat zoomScale;
@property (nonatomic, assign, readonly) CGPoint contentOffset;
@property (nonatomic, assign, readonly) UIEdgeInsets contentInset;

@end

Expand Down

0 comments on commit b735cdf

Please sign in to comment.