diff --git a/package.json b/package.json index 2252c82..ce86e72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-datalist-input", - "version": "1.1.22", + "version": "1.1.23", "description": "This package provides a react component as follows: an input field with a drop down menu to pick a possible option based on the current input.", "main": "./lib/DataListInput.js", "license": "MIT", diff --git a/src/DataListInput.jsx b/src/DataListInput.jsx index 851b3d6..44129f0 100644 --- a/src/DataListInput.jsx +++ b/src/DataListInput.jsx @@ -71,7 +71,7 @@ class DataListInput extends React.Component { const displayableItems = matchingItems.length ? matchingItems : items.slice( 0, dropDownLength ) let index = lastValidItem && !clearInputOnSelect - ? indexOfItem( lastValidItem, displayableItems ) : 0; + ? this.indexOfItem( lastValidItem, displayableItems ) : 0; index = index > 0 ? index : 0; this.setState( { visible: true, matchingItems: displayableItems, focusIndex: index, } ); }