This commit is contained in:
andrelandgraf 2019-06-12 22:01:56 +02:00
parent 9ee835e68f
commit 7924ed82a0
4 changed files with 5 additions and 8 deletions

View File

@ -165,7 +165,7 @@ class DataListInput extends React.Component {
const reachedRequiredLength = currentInput.length >= requiredInputLength;
return (
<div className="datalist-input">
{ this.renderInputField( placeholder, valu, inputClassName ) }
{ this.renderInputField( placeholder, currentInput, inputClassName ) }
{ reachedRequiredLength && visible &&
this.renderItems( matchingItems, focusIndex, activeItemClassName, itemClassName )
}

View File

@ -1,6 +1,6 @@
{
"name": "react-datalist-input",
"version": "1.0.5",
"version": "1.0.7",
"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": "build/index.js",
"repository": {

View File

@ -5,16 +5,13 @@
width: 100%;
height: 100%;
}
input {
.autocomplete-input {
border: 1px solid transparent;
background-color: #f1f1f1;
width: 100%;
height: 100%;
}
input[type=text] {
background-color: #f1f1f1;
width: 100%;
}
.datalist-items {
position: absolute;
border: 1px solid #d4d4d4;

View File

@ -176,7 +176,7 @@ class DataListInput extends React.Component {
const reachedRequiredLength = currentInput.length >= requiredInputLength;
return (
<div className="datalist-input">
{ this.renderInputField( placeholder, valu, inputClassName ) }
{ this.renderInputField( placeholder, currentInput, inputClassName ) }
{ reachedRequiredLength && visible &&
this.renderItems( matchingItems, focusIndex, activeItemClassName, itemClassName )
}