Skip to content

Commit 1561771

Browse files
committed
Fixes #16
1 parent c0a0696 commit 1561771

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Change valueExtractor and pass the data to Autocomplete without fetchDataUrl
144144
listHeader | Text at the beginning of suggestions | String | -
145145
fetchDataUrl | Data source url | String | -
146146
noDataText | Text to display when no results | String | No Results
147+
initialValue | Text to display initially | String | -
147148
inputContainerStyle | Styles for autocomplete container | Object | -
148149
inputStyle | Styles for autocomplete input | Object | -
149150
spinnerStyle | Styles for activity indicator | Object | -

components/Autocomplete/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Autocomplete extends Component {
1313
constructor(props) {
1414
super(props);
1515
this.state = {
16-
inputValue: "",
16+
inputValue: props.initialValue || "",
1717
loading: false,
1818
filteredItems: [],
1919
};

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type AutocompleteProps = {
1818
listHeader?: string,
1919
fetchDataUrl?: string,
2020
noDataText?: string;
21+
initialValue?: string;
2122
inputContainerStyle?: StyleProp<ViewStyle>;
2223
inputStyle?: StyleProp<TextStyle>;
2324
spinnerStyle?: StyleProp<ViewStyle>;

0 commit comments

Comments
 (0)