Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated documentation to fix #254 #256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ React.render(
[3]: http://wookiehangover.github.com/react-typeahead/examples/TypeaheadTokenizer-simple.html
[4]: http://blog.npmjs.org/post/85484771375/how-to-install-npm

## Arrow keys navigation

Typeahead supports selection of elements using the arrow keys (up/down) and ENTER to select. When an item is selected this way, it gains the `hover` class. You can use this class to style the selected item as you wish.

## API

### Typeahead(props)
Expand Down Expand Up @@ -224,10 +228,31 @@ If true, custom tags can be added without a matching typeahead selection

### Typeahead ([Exposed Component Functions][reactecf])

The exposed component functions can be used like so:

```jsx
//In constructor:
this.typeaheadRef = React.createRef(); //The new way to create refs in react.

//Somewhere later in the code:
<Typeahead
ref={this.typeaheadRef}
...
/>

//Example usage:
this.typeaheadRef.current.setEntryText("");
```
#### typeahead.focus

Focuses the typeahead input.

#### typeahead.setEntryText(string)

Accepts: `string`

Sets the text in the input box. Set to `""` to clear.

---

### Tokenizer(props)
Expand Down