Constructor
# <SelectTextField className id label disabled options onChange onOpen onClose value aria-label getOptionLabel clearText createEntryText createEntryTextShort />
Textfield behaving as a select field.
The user can type some text in the textfield. The component will show suitable options in a list below the field. The user must have selected such an option so that the field gets valid.
PropTypes:
Name | Type | Required | Description | Default |
---|---|---|---|---|
className |
string | No | @ignore | |
id |
string | No | Used as the field id. Uses a randomly generated one if not set. | |
label |
string | No | Label text for the text field. | |
disabled |
bool | No | If `true`, the input will be disabled. | |
options |
array | Yes | Array of options. | |
onChange |
func | No | Callback when input text has changed | () => {} |
onOpen |
func | No | Callback when the autocomplete list will be opened. | |
onClose |
func | No | Callback when the autocomplete list will be closed. | |
value |
string | No | The value of the field. | |
aria-label |
string | No | Label used to improve accessibility. | |
getOptionLabel |
func | No | Used to determine the string value for a given option. | x => x |
clearText |
string | No | Override the default text for the *clear* icon button. | 'clear' |
createEntryText |
string | No | Override the default text for the *create entry* hint rendered next to the input field. | 'Create a new entry' |
createEntryTextShort |
string | No | Override the default text for the *create entry* menu item. | 'New entry' |