Add support for drawableLeft and drawablePadding props

Summary: Add support inlining images into text inputs. For now this is only available on Android.

Reviewed By: andreicoman11

Differential Revision: D3470805

fbshipit-source-id: 14db05ec4d5af549bf314b903654314f39bf73ea
This commit is contained in:
Martín Bigio
2016-06-28 14:11:23 -07:00
committed by Facebook Github Bot 8
parent 54ed44628d
commit eafc5dac62
4 changed files with 55 additions and 4 deletions

View File

@@ -419,6 +419,18 @@ const TextInput = React.createClass({
* @platform android
*/
underlineColorAndroid: ColorPropType,
/**
* If defined, the provided image resource will be rendered on the left.
* @platform android
*/
inlineImageLeft: PropTypes.string,
/**
* Padding between the inline image, if any, and the text input itself.
* @platform android
*/
inlineImagePadding: PropTypes.number,
},
/**
@@ -638,6 +650,8 @@ const TextInput = React.createClass({
selectionColor={this.props.selectionColor}
text={this._getText()}
underlineColorAndroid={this.props.underlineColorAndroid}
inlineImageLeft={this.props.inlineImageLeft}
inlineImagePadding={this.props.inlineImagePadding}
children={children}
editable={this.props.editable}
selectTextOnFocus={this.props.selectTextOnFocus}