mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Implement caretHidden in multiline text input
Summary: Changelog: [internal] Add missing implementation of caretHidden to multiline text input. This will work for both React Native Classic and New React Native Renderer. Reviewed By: shergin Differential Revision: D26818087 fbshipit-source-id: 3597604a6bd414a4a3b292d809d63a18efa8acb3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
da8ed6b625
commit
7e81c1d483
@@ -33,8 +33,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// it's declared here only to conform to the interface.
|
||||
@property (nonatomic, assign) UITextFieldViewMode clearButtonMode;
|
||||
|
||||
// The `caretHidden` property actually is not supported yet;
|
||||
// it's declared here only to conform to the interface.
|
||||
@property (nonatomic, assign) BOOL caretHidden;
|
||||
|
||||
@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID;
|
||||
|
||||
@@ -165,8 +165,6 @@ static UIColor *defaultPlaceholderColor()
|
||||
[self textDidChange];
|
||||
}
|
||||
|
||||
#pragma mark - Overrides
|
||||
|
||||
- (void)setSelectedTextRange:(UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate
|
||||
{
|
||||
if (!notifyDelegate) {
|
||||
@@ -298,6 +296,17 @@ static UIColor *defaultPlaceholderColor()
|
||||
return textAttributes;
|
||||
}
|
||||
|
||||
#pragma mark - Caret Manipulation
|
||||
|
||||
- (CGRect)caretRectForPosition:(UITextPosition *)position
|
||||
{
|
||||
if (_caretHidden) {
|
||||
return CGRectZero;
|
||||
}
|
||||
|
||||
return [super caretRectForPosition:position];
|
||||
}
|
||||
|
||||
#pragma mark - Utility Methods
|
||||
|
||||
- (void)copyTextAttributesFrom:(NSAttributedString *)sourceString
|
||||
|
||||
Reference in New Issue
Block a user