mirror of
https://github.com/status-im/react-native.git
synced 2025-01-29 02:35:41 +00:00
8f93ce680d
Summary: Now the business logic of `blurOnSubmit` is pretty simple and lives inside `RCTTextInput`, whereas UIKit hacks/workarounds lives inside `RCTBackedTextInputDelegateAdapter`. Reviewed By: javache Differential Revision: D5299397 fbshipit-source-id: 6a9d4194324ff9446c74fdb32ad5357e849e471d
54 lines
1.6 KiB
Objective-C
54 lines
1.6 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <React/RCTView.h>
|
|
|
|
#import "RCTBackedTextInputViewProtocol.h"
|
|
|
|
@class RCTBridge;
|
|
@class RCTEventDispatcher;
|
|
|
|
@interface RCTTextInput : RCTView {
|
|
@protected
|
|
RCTBridge *_bridge;
|
|
RCTEventDispatcher *_eventDispatcher;
|
|
UITextRange *_previousSelectionRange;
|
|
NSInteger _nativeEventCount;
|
|
NSInteger _mostRecentEventCount;
|
|
BOOL _blurOnSubmit;
|
|
}
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
|
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
|
|
|
|
@property (nonatomic, readonly) UIView<RCTBackedTextInputViewProtocol> *backedTextInputView;
|
|
|
|
@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets;
|
|
@property (nonatomic, assign) UIEdgeInsets reactBorderInsets;
|
|
@property (nonatomic, assign, readonly) CGSize contentSize;
|
|
|
|
@property (nonatomic, copy) RCTDirectEventBlock onContentSizeChange;
|
|
|
|
@property (nonatomic, assign) NSInteger mostRecentEventCount;
|
|
@property (nonatomic, assign) BOOL blurOnSubmit;
|
|
|
|
- (void)invalidateContentSize;
|
|
|
|
// Temporary exposure of particial `RCTBackedTextInputDelegate` support.
|
|
// In the future all methods of the protocol should move to this class.
|
|
- (BOOL)textInputShouldReturn;
|
|
- (void)textInputDidReturn;
|
|
|
|
@end
|