diff --git a/components/Autocomplete/index.js b/components/Autocomplete/index.js index 9cbd740..2c616e5 100644 --- a/components/Autocomplete/index.js +++ b/components/Autocomplete/index.js @@ -124,7 +124,7 @@ class Autocomplete extends Component { if (resetOnSelect) { this.setState({inputValue: ""}); } else { - const capitalizedValue = capitalizeFirstLetter(valueExtractor(value)); + const capitalizedValue = this.props.firstLetterCapital ? capitalizeFirstLetter(valueExtractor(value)) : valueExtractor(value); this.setState({inputValue: capitalizedValue}); } } @@ -171,6 +171,7 @@ class Autocomplete extends Component { placeholderColor, data, disableFullscreenUI, + autoCapitalize, ...dropdownProps } = this.props; @@ -191,6 +192,7 @@ class Autocomplete extends Component { autoCorrect={autoCorrect} keyboardType={keyboardType} onChangeText={text => this.handleInputChange(text)} + autoCapitalize={autoCapitalize} onFocus={event => { if (scrollToInput) { scrollToInput(findNodeHandle(event.target)); @@ -230,6 +232,7 @@ Autocomplete.defaultProps = { highlightText: true, waitInterval: WAIT_INTERVAL, resetOnSelect: false, + firstLetterCapital: true, }; Autocomplete.propTypes = { @@ -245,6 +248,7 @@ Autocomplete.propTypes = { autoCorrect: bool, keyboardType: string, resetOnSelect: bool, + firstLetterCapital: bool, valueExtractor: func, renderIcon: func, diff --git a/index.d.ts b/index.d.ts index 2591e7c..584c58a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -31,6 +31,7 @@ type AutocompleteProps = { rightContentStyle?: StyleProp; rightContentItemStyle?: StyleProp; listHeaderTextStyle?: StyleProp; + listItemTextStyle?: StyleProp; overlayStyle?: StyleProp; pickerStyle?: StyleProp; containerStyle?: StyleProp;