diff --git a/package.json b/package.json index eee71e6..bcb25cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-datalist-input", - "version": "1.1.26", + "version": "1.1.27", "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 10cfc5b..4b20283 100644 --- a/src/DataListInput.jsx +++ b/src/DataListInput.jsx @@ -74,7 +74,7 @@ class DataListInput extends React.Component { const currentInputIsLastItem = !clearInputOnSelect && lastValidItem && lastValidItem.label === currentInput; const displayableItems = matchingItems.length && !currentInputIsLastItem - ? matchingItems : items.slice( 0, dropDownLength ); + ? matchingItems.slice( 0, dropDownLength ) : items.slice( 0, dropDownLength ); let index = lastValidItem && !clearInputOnSelect ? this.indexOfItem( lastValidItem, displayableItems ) : 0;