Skip to content

Commit

Permalink
[TextInput] Fix iOS backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Oct 29, 2020
1 parent c33f895 commit 4f8252f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Libraries/Text/TextInput/Singleline/RCTUITextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,18 @@ - (void)setSecureTextEntry:(BOOL)secureTextEntry
{
NSMutableDictionary<NSAttributedStringKey, id> *textAttributes = [_defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new];

[textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor]
forKey:NSForegroundColorAttributeName]; // TODO(macOS ISS#2323203)
// [TODO(OSS Candidate ISS#2710739)
if (@available(iOS 13.0, *)) {
[textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor]
forKey:NSForegroundColorAttributeName];
} else {
// ]TODO(OSS Candidate ISS#2710739)
if (self.placeholderColor) {
[textAttributes setValue:self.placeholderColor forKey:NSForegroundColorAttributeName];
} else {
[textAttributes removeObjectForKey:NSForegroundColorAttributeName];
}
}

return textAttributes;
}
Expand Down

0 comments on commit 4f8252f

Please sign in to comment.