Update Autocomplete TypeScript declaration file and readme with key callbacks

old
Landon Petzoldt 2017-12-21 14:16:49 -06:00
parent 2c92c37080
commit b79c3da04d
2 changed files with 11 additions and 1 deletions

View File

@ -88,6 +88,14 @@ export interface AutocompleteProps extends InputProps {
* Callback function that is fired when component is focused.
*/
onFocus?: Function;
/**
* Callback function that is fired when a key is pressed down.
*/
onKeyDown?: Function;
/**
* Callback function that is fired when a key is lifted up.
*/
onKeyUp?: Function;
/**
* Callback function that is fired when the components's query value changes.
*/

View File

@ -53,8 +53,10 @@ If you want to provide a theme via context, the component key is `RTAutocomplete
| `multiple` | `Bool` | `true` | If true, component can hold multiple values. |
| `onBlur` | `Function` | | Callback function that is fired when component is blurred. |
| `onChange` | `Function` | | Callback function that is fired when the components's value changes. |
| `onQueryChange` | `Function` | | Callback function that is fired when the components's query input value changes. |
| `onFocus` | `Function` | | Callback function that is fired when component is focused. |
| `onKeyDown` | `Function` | | Callback function that is fired when a key is pressed down. |
| `onKeyUp` | `Function` | | Callback function that is fired when a key is lifted up. |
| `onQueryChange` | `Function` | | Callback function that is fired when the components's query input value changes. |
| `query` | `String` | | This property has to be used in case the `source` is not static and will be changing during search for `multiple={false}` autocomplete, content of the `query` has to be managed by the `onQueryChange` callback. |
| `source` | `Object` or `Array` | | Object of key/values or array representing all items suggested. |
| `selectedPosition` | `String` | `above` | Determines if the selected list is shown above or below input. It can be `above`, `below` or `none`. |