react-datalist-input
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -27,6 +27,5 @@ import React from 'react'; | ||
* gets called when someone starts to write in the input field | ||
* @param event | ||
* @param value | ||
*/ | ||
onHandleInput = (event) => { | ||
const currentInput = event.target.value; | ||
onHandleInput = (currentInput) => { | ||
const matchingItems = this.props.items.filter((item) => { | ||
@@ -38,4 +37,4 @@ if (typeof(this.props.match) === typeof(Function)) | ||
this.setState({ | ||
currentInput: currentInput, | ||
matchingItems: matchingItems, | ||
currentInput, | ||
matchingItems, | ||
focusIndex: 0, | ||
@@ -159,3 +158,3 @@ visible: true, | ||
renderInputField = ( placeholder, currentInput, inputClassName ) => ( | ||
<input onKeyDown={this.onHandleKeydown} onInput={this.onHandleInput} type="text" | ||
<input onKeyDown={this.onHandleKeydown} onChange={this.onHandleInput} type="text" | ||
className={ `autocomplete-input ${inputClassName}` } | ||
@@ -162,0 +161,0 @@ placeholder={placeholder} value={currentInput}/> |
{ | ||
"name": "react-datalist-input", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"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.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -38,4 +38,3 @@ import React from 'react'; | ||
*/ | ||
onHandleInput(event) { | ||
const currentInput = event.target.value; | ||
onHandleInput(currentInput) { | ||
const matchingItems = this.props.items.filter((item) => { | ||
@@ -47,4 +46,4 @@ if (typeof(this.props.match) === typeof(Function)) | ||
this.setState({ | ||
currentInput: currentInput, | ||
matchingItems: matchingItems, | ||
currentInput, | ||
matchingItems, | ||
focusIndex: 0, | ||
@@ -51,0 +50,0 @@ visible: true, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104784
2519