Skip to content

Commit

Permalink
fix(ios): add caretColor property support
Browse files Browse the repository at this point in the history
  • Loading branch information
ruifanyuan authored and hippy-actions[bot] committed Nov 6, 2023
1 parent 00f54e8 commit 46b4e77
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ - (void)setKeyboardType:(UIKeyboardType)keyboardType {
}
}

- (UIColor*)caretColor{
return self.tintColor;
}

- (void)setCaretColor:(UIColor*)color{
self.tintColor = color;
}

- (void)setReturnKeyType:(UIReturnKeyType) returnKeyType{
[super setReturnKeyType:returnKeyType];
if([self isFirstResponder]){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ - (BOOL)resignFirstResponder {
return [super resignFirstResponder];
}

- (void)setKeyboardType:(UIKeyboardType)keyboardType {
[super setKeyboardType:keyboardType];

if([self isFirstResponder]){
[self reloadInputViews];
}
}

- (UIColor*)caretColor{
return self.tintColor;
}

- (void)setCaretColor:(UIColor*)color{
self.tintColor = color;
}
@end

@interface NativeRenderTextView () <NativeRenderUITextViewResponseDelegate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ - (HippyShadowView *)hippyShadowView {
HIPPY_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)
HIPPY_EXPORT_VIEW_PROPERTY(selection, NativeRenderTextSelection)
HIPPY_EXPORT_VIEW_PROPERTY(text, NSString)
HIPPY_REMAP_VIEW_PROPERTY(caretColor, textView.caretColor, UIColor)

HIPPY_CUSTOM_SHADOW_PROPERTY(fontSize, NSNumber, NativeRenderObjectTextView) {
view.font = [HippyFont updateFont:view.font withSize:json];
Expand Down

0 comments on commit 46b4e77

Please sign in to comment.