only show menu if matches are there

This commit is contained in:
Andre Landgraf 2019-06-13 18:10:15 +02:00
parent 996553f044
commit 30dafc8838
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "react-datalist-input",
"version": "1.1.10",
"version": "1.1.11",
"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",

View File

@ -40,7 +40,12 @@ class DataListInput extends React.Component {
visible: true,
} );
} else {
this.setState( { currentInput } )
this.setState( {
currentInput,
matchingItems,
visible: false,
focusIndex: -1,
} )
}
};