react-geosuggest-plus
Advanced tools
Comparing version 1.14.1 to 1.15.0
@@ -316,3 +316,5 @@ /* global google */ | ||
var suggestsCount = this.state.suggests.length - 1, | ||
var suggestsLength = this.state.suggests.length; | ||
var recentsLength = this.state.recents.length; | ||
var suggestsCount = recentsLength + suggestsLength - 1, | ||
next = direction === 'next', | ||
@@ -324,3 +326,3 @@ newActiveSuggest = null, | ||
for (i; i <= suggestsCount; i++) { | ||
if (this.state.suggests[i] === this.state.activeSuggest) { | ||
if (this.state.suggests[i] === this.state.activeSuggest || this.state.recents[i] === this.state.activeSuggest) { | ||
newIndex = next ? i + 1 : i - 1; | ||
@@ -335,3 +337,10 @@ } | ||
if (newIndex >= 0 && newIndex <= suggestsCount) { | ||
newActiveSuggest = this.state.suggests[newIndex]; | ||
// if suggests not full but recents is | ||
if (!suggestsLength && recentsLength) { | ||
newActiveSuggest = this.state.recents[newIndex]; | ||
} else if (suggestsLength && recentsLength && newIndex >= suggestsLength) { | ||
newActiveSuggest = this.state.recents[newIndex]; | ||
} else { | ||
newActiveSuggest = this.state.suggests[newIndex]; | ||
} | ||
} | ||
@@ -338,0 +347,0 @@ |
{ | ||
"name": "react-geosuggest-plus", | ||
"version": "1.14.1", | ||
"version": "1.15.0", | ||
"description": "A React autosuggest for the Google Maps Places API.", | ||
@@ -34,3 +34,4 @@ "main": "./dist/Geosuggest", | ||
"scripts": { | ||
"prepublish": "make build" | ||
"prepublish": "make build", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
@@ -37,0 +38,0 @@ "readmeFilename": "README.md", |
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
41709
633