mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 22:45:24 +08:00
Fix StyleSheet 'textAlign' for AndroidTextInput. Closes #2702
Summary: change `setTextAlign` and `setTextAlignVertical` to receive argument of type `String` (the same as in `StyleSheet`), so that native props and stylesheet props are calling the same ReactMethod - add demo (may not be necessary) Closes https://github.com/facebook/react-native/pull/4481 Reviewed By: svcscm Differential Revision: D2823456 Pulled By: mkonicek fb-gh-sync-id: 349d17549f419b5bdc001d70b583423ade06bfe8
This commit is contained in:
committed by
facebook-github-bot-7
parent
dc96935681
commit
f453e14c8f
@@ -101,24 +101,6 @@ var TextInput = React.createClass({
|
||||
* The default value is false.
|
||||
*/
|
||||
autoFocus: PropTypes.bool,
|
||||
/**
|
||||
* Set the position of the cursor from where editing will begin.
|
||||
* @platform android
|
||||
*/
|
||||
textAlign: PropTypes.oneOf([
|
||||
'start',
|
||||
'center',
|
||||
'end',
|
||||
]),
|
||||
/**
|
||||
* Aligns text vertically within the TextInput.
|
||||
* @platform android
|
||||
*/
|
||||
textAlignVertical: PropTypes.oneOf([
|
||||
'top',
|
||||
'center',
|
||||
'bottom',
|
||||
]),
|
||||
/**
|
||||
* If false, text is not editable. The default value is true.
|
||||
*/
|
||||
@@ -491,10 +473,6 @@ var TextInput = React.createClass({
|
||||
|
||||
var autoCapitalize =
|
||||
UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];
|
||||
var textAlign = UIManager.AndroidTextInput.Constants.TextAlign[this.props.textAlign];
|
||||
var textAlignVertical =
|
||||
UIManager.AndroidTextInput.Constants.TextAlignVertical[this.props.textAlignVertical];
|
||||
|
||||
var children = this.props.children;
|
||||
var childCount = 0;
|
||||
ReactChildren.forEach(children, () => ++childCount);
|
||||
@@ -512,8 +490,6 @@ var TextInput = React.createClass({
|
||||
style={[this.props.style]}
|
||||
autoCapitalize={autoCapitalize}
|
||||
autoCorrect={this.props.autoCorrect}
|
||||
textAlign={textAlign}
|
||||
textAlignVertical={textAlignVertical}
|
||||
keyboardType={this.props.keyboardType}
|
||||
mostRecentEventCount={0}
|
||||
multiline={this.props.multiline}
|
||||
|
||||
Reference in New Issue
Block a user