diff --git a/README.md b/README.md index e04ce55c..fe753361 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,14 @@ If true, options will still be rendered when there is no value. Focuses the typeahead input. +#### typeahead.setEntryText(value) + +Sets the value of the input field to `value`. + +#### typeahead.clearSelectionIndex + +Clears the currently selected option index. + --- ### Tokenizer(props) diff --git a/src/typeahead/index.js b/src/typeahead/index.js index a33d285e..dee2def1 100644 --- a/src/typeahead/index.js +++ b/src/typeahead/index.js @@ -202,6 +202,10 @@ var Typeahead = React.createClass({ }, _onEscape: function() { + this.clearSelectionIndex(); + }, + + clearSelectionIndex: function() { this.setState({ selectionIndex: null });