react-datalist-input
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -115,4 +115,10 @@ import React from 'react'; | ||
onSelect = (selectedItem) => { | ||
if (selectedItem.key === this.state.lastValidItem.key) { | ||
// do nothing onClick if key has not change since the last selection | ||
if (this.state.lastValidItem !== undefined && selectedItem.key === this.state.lastValidItem.key){ | ||
// do not trigger the callback function | ||
// but still change state to fit new selection | ||
this.setState({ | ||
currentInput: selectedItem.label, | ||
visible: false, | ||
focusIndex: -1, | ||
}); | ||
return; | ||
@@ -119,0 +125,0 @@ } |
{ | ||
"name": "react-datalist-input", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"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", |
@@ -122,4 +122,10 @@ import React from 'react'; | ||
onSelect(selectedItem) { | ||
if (selectedItem.key === this.state.lastValidItem.key) { | ||
// do nothing onClick if key has not change since the last selection | ||
if (this.state.lastValidItem !== undefined && selectedItem.key === this.state.lastValidItem.key){ | ||
// do not trigger the callback function | ||
// but still change state to fit new selection | ||
this.setState({ | ||
currentInput: selectedItem.label, | ||
visible: false, | ||
focusIndex: -1, | ||
}); | ||
return; | ||
@@ -126,0 +132,0 @@ } |
Sorry, the diff of this file is too big to display
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
89323
2164