Skip to content

Commit

Permalink
Merge pull request #17 from maxkordiyak/initial-value
Browse files Browse the repository at this point in the history
Option to set an initial value
  • Loading branch information
docker-run authored Aug 8, 2019
2 parents cb23031 + 1561771 commit e75ee40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Change valueExtractor and pass the data to Autocomplete without fetchDataUrl
listHeader | Text at the beginning of suggestions | String | -
fetchDataUrl | Data source url | String | -
noDataText | Text to display when no results | String | No Results
initialValue | Text to display initially | String | -
inputContainerStyle | Styles for autocomplete container | Object | -
inputStyle | Styles for autocomplete input | Object | -
spinnerStyle | Styles for activity indicator | Object | -
Expand Down
2 changes: 1 addition & 1 deletion components/Autocomplete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Autocomplete extends Component {
constructor(props) {
super(props);
this.state = {
inputValue: "",
inputValue: props.initialValue || "",
loading: false,
filteredItems: [],
};
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type AutocompleteProps = {
listHeader?: string,
fetchDataUrl?: string,
noDataText?: string;
initialValue?: string;
inputContainerStyle?: StyleProp<ViewStyle>;
inputStyle?: StyleProp<TextStyle>;
spinnerStyle?: StyleProp<ViewStyle>;
Expand Down

0 comments on commit e75ee40

Please sign in to comment.