From 2ff4e8d57a229c66415b770f76dbef7032624f4f Mon Sep 17 00:00:00 2001 From: micheleantonazzi Date: Thu, 9 Apr 2020 15:21:32 +0200 Subject: [PATCH 1/4] Add autoCapitalize on textInput --- components/Autocomplete/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/Autocomplete/index.js b/components/Autocomplete/index.js index 9cbd740..23bc295 100644 --- a/components/Autocomplete/index.js +++ b/components/Autocomplete/index.js @@ -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)); From bf4301019082610c4ddf4e5987b0467268b0c7d8 Mon Sep 17 00:00:00 2001 From: Michele Antonazzi Date: Thu, 9 Apr 2020 22:35:34 +0200 Subject: [PATCH 2/4] Add listItemTextStyle as new prop definition --- index.d.ts | 1 + 1 file changed, 1 insertion(+) 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; From d69bd3f4709c511b1353c62c0096fc2650418197 Mon Sep 17 00:00:00 2001 From: Michele Antonazzi Date: Fri, 10 Apr 2020 09:20:33 +0200 Subject: [PATCH 3/4] Add new property: firstCapitalLetter --- components/Autocomplete/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Autocomplete/index.js b/components/Autocomplete/index.js index 23bc295..5ae536d 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 === true ? capitalizeFirstLetter(valueExtractor(value)) : valueExtractor(value); this.setState({inputValue: capitalizedValue}); } } @@ -232,6 +232,7 @@ Autocomplete.defaultProps = { highlightText: true, waitInterval: WAIT_INTERVAL, resetOnSelect: false, + firstLetterCapital: true, }; Autocomplete.propTypes = { @@ -247,6 +248,7 @@ Autocomplete.propTypes = { autoCorrect: bool, keyboardType: string, resetOnSelect: bool, + firstLetterCapital: bool, valueExtractor: func, renderIcon: func, From 78bbbc549534eba4d4756c16969bf028b3f87259 Mon Sep 17 00:00:00 2001 From: Michele Antonazzi Date: Thu, 21 May 2020 11:47:31 +0200 Subject: [PATCH 4/4] index.js: fix conditional which refers to firstLetterCapital property --- components/Autocomplete/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Autocomplete/index.js b/components/Autocomplete/index.js index 5ae536d..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 = this.props.firstLetterCapital === true ? capitalizeFirstLetter(valueExtractor(value)) : valueExtractor(value); + const capitalizedValue = this.props.firstLetterCapital ? capitalizeFirstLetter(valueExtractor(value)) : valueExtractor(value); this.setState({inputValue: capitalizedValue}); } }