react-native/ReactKit/Views/RCTTextFieldManager.m
Christopher Chedeau 6153fffb30 2015-02-03 updates
- Add back providesModule transform to JSAppServer | Joseph Savona
- [ReactKit] fix open source performance issue | John Harper
- [ReactKit] improve ReactIOSEventEmitter logics | Andrew Rasmussen
- [reactkit] fix web view JS executor and bind it to Command-d | John Harper
- Removed hardcoded RCTModuleIDs | Nick Lockwood
- [ReactKit] Animated GIF support | Alex Akers
- [ReactKit] Update RCTBridge to support non-`id` argument types | Alex Akers
- [reactkit] fix typo in RCTCopyProperty() change | John Harper
- [reactkit] fix shadow view crash on missing properties | John Harper
- [reactkit] fix transform keypath | John Harper
2015-02-03 16:15:20 -08:00

52 lines
1.4 KiB
Objective-C

// Copyright 2004-present Facebook. All Rights Reserved.
#import "RCTTextFieldManager.h"
#import "RCTConvert.h"
#import "RCTShadowView.h"
#import "RCTTextField.h"
@implementation RCTTextFieldManager
- (UIView *)view
{
return [[RCTTextField alloc] initWithEventDispatcher:self.eventDispatcher];
}
RCT_EXPORT_VIEW_PROPERTY(caretHidden)
RCT_EXPORT_VIEW_PROPERTY(autoCorrect)
RCT_EXPORT_VIEW_PROPERTY(enabled)
RCT_EXPORT_VIEW_PROPERTY(placeholder)
RCT_EXPORT_VIEW_PROPERTY(text)
RCT_EXPORT_VIEW_PROPERTY(font)
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType)
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
RCT_REMAP_VIEW_PROPERTY(color, textColor)
- (void)set_fontSize:(id)json
forView:(RCTTextField *)view
withDefaultView:(RCTTextField *)defaultView
{
view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
}
- (void)set_FontWeight:(id)json
forView:(RCTTextField *)view
withDefaultView:(RCTTextField *)defaultView
{
view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO
}
- (void)set_fontFamily:(id)json
forView:(RCTTextField *)view
withDefaultView:(RCTTextField *)defaultView
{
view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName];
}
// TODO: original code set view.paddingEdgeInsets from shadowView.paddingAsInsets
// could it be that this property is calculated asynchrously on shadow thread?
@end