Further i18nified Autocomplete

This commit is contained in:
Philipp Czora
2018-11-22 10:55:21 +01:00
parent c23e0f4610
commit 69910ab2c6
6 changed files with 37 additions and 6 deletions

View File

@@ -14,7 +14,10 @@ type Props = {
buttonLabel: string,
fieldLabel: string,
helpText?: string,
loadSuggestions: string => Promise<AutocompleteObject>
loadSuggestions: string => Promise<AutocompleteObject>,
placeholder?: string,
loadingMessage?: string,
noOptionsMessage?: string
};
type State = {
@@ -27,7 +30,7 @@ class AutocompleteAddEntryToTableField extends React.Component<Props, State> {
this.state = { selectedValue: undefined };
}
render() {
const { disabled, buttonLabel, fieldLabel, helpText, loadSuggestions } = this.props;
const { disabled, buttonLabel, fieldLabel, helpText, loadSuggestions, placeholder, loadingMessage, noOptionsMessage } = this.props;
const { selectedValue } = this.state;
return (
@@ -38,6 +41,9 @@ class AutocompleteAddEntryToTableField extends React.Component<Props, State> {
valueSelected={this.handleAddEntryChange}
helpText={helpText}
value={selectedValue}
placeholder={placeholder}
loadingMessage={loadingMessage}
noOptionsMessage={noOptionsMessage}
/>
<AddButton