(Object, Component<Datalist>). Functions similarly to a vanilla input[type='datalist']
, which functions as a compromise between .type = ‘search_select’ (Component<SearchSelect>) and a regular text input. Auto-formatting functions are also available onchange.
Nesting is not supported for datalists for obvious reasons. See ‘search_select’ instead for a better option.
Note. ‘Returns:’ refers to what the Component value returns when exported to its .variable
binding.
<component_key>: (Object, Component<Datalist>)
- Inherits from Component.
- name: (String, Localisation) - Optional.
- placeholder: (String, Localisation) - Optional. Determines what the value of the datalist is by default. Overrides bound
.variable
.
- autoformat: (Function) - Optional. Passes in the user's input string as its only parameter. The returned String is given as the value; used for ensuring compatibility (i.e. for ordinals). Return type (String).
- autoformat_no_spaces: (Boolean) - Optional. Replaces all spaces with underscores to be compatible with snakecase if enabled. False by default.
- autoformat_numbers_only: (Boolean) - Optional. Whether only numbers are allowed. False by default.
- autoformat_ordinals_only: (Boolean) - Optional. Whether only ordinals are allowed. False by default.
- max: (Number) - Optional. The maximum allowed in the datalist. Only allows numbers if true. False by default.
- min: (Number) - Optional. The minimum allowed in the datalist. Only allows numbers if true. False by default.
- only_key_names: (Boolean) - Whether the datalist supports only valid key_names. If not, it will show the user an Error Toast.
- options: (Function/Object<String, String>)
- Returns: (Number/String) - The selected ID if available. If unavailable, or the user has inputted something else, it returns the user input instead. If it only allows numbers, it will return a Number instead.