diff --git a/docs/components/TextInput.md b/docs/components/TextInput.md index 7dfd9cdb..a4ff31ac 100644 --- a/docs/components/TextInput.md +++ b/docs/components/TextInput.md @@ -20,6 +20,15 @@ Unsupported React Native props: [...View props](./View.md) +**autoCapitalize**: oneOf('characters', 'none', 'sentences', 'words') = 'sentences' + +Automatically capitalize certain characters (only available in Chrome and iOS Safari). + +* `characters`: Automatically capitalize all characters. +* `none`: Completely disables automatic capitalization +* `sentences`: Automatically capitalize the first letter of sentences. +* `words`: Automatically capitalize the first letter of words. + (web) **autoComplete**: bool = false Indicates whether the value of the control can be automatically completed by the browser. diff --git a/src/components/TextInput/index.js b/src/components/TextInput/index.js index 5ac7492c..fa088a5a 100644 --- a/src/components/TextInput/index.js +++ b/src/components/TextInput/index.js @@ -19,6 +19,7 @@ class TextInput extends Component { static propTypes = { ...View.propTypes, + autoCapitalize: PropTypes.oneOf([ 'characters', 'none', 'sentences', 'words' ]), autoComplete: PropTypes.bool, autoFocus: PropTypes.bool, clearTextOnFocus: PropTypes.bool, @@ -47,6 +48,7 @@ class TextInput extends Component { }; static defaultProps = { + autoCapitalize: 'sentences', editable: true, keyboardType: 'default', multiline: false, @@ -83,6 +85,7 @@ class TextInput extends Component { render() { const { accessibilityLabel, // eslint-disable-line + autoCapitalize, autoComplete, autoFocus, defaultValue, @@ -138,6 +141,7 @@ class TextInput extends Component { const textStyles = omit(flattenedStyle, viewStyleProps); const propsCommon = { + autoCapitalize, autoComplete: autoComplete && 'on', autoFocus, defaultValue,