react-google-autocomplete
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -44,13 +44,16 @@ 'use strict'; | ||
types = _props$types === undefined ? ['(cities)'] : _props$types, | ||
_props$componentRestr = _props.componentRestrictions, | ||
componentRestrictions = _props$componentRestr === undefined ? {} : _props$componentRestr, | ||
componentRestrictions = _props.componentRestrictions, | ||
bounds = _props.bounds; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
var config = { | ||
types: types, | ||
componentRestrictions: componentRestrictions, | ||
bounds: bounds | ||
}); | ||
}; | ||
if (componentRestrictions) { | ||
config.componentRestrictions = componentRestrictions; | ||
} | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, config); | ||
this.autocomplete.addListener('place_changed', this.onSelected.bind(this)); | ||
@@ -57,0 +60,0 @@ } |
{ | ||
"name": "react-google-autocomplete", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "React component for google autocomplete.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,10 +17,14 @@ import React, {PropTypes} from 'react'; | ||
componentDidMount() { | ||
const { types=['(cities)'], componentRestrictions={}, bounds, } = this.props; | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, { | ||
const { types=['(cities)'], componentRestrictions, bounds, } = this.props; | ||
const config = { | ||
types, | ||
componentRestrictions, | ||
bounds, | ||
}); | ||
}; | ||
if (componentRestrictions) { | ||
config.componentRestrictions = componentRestrictions; | ||
} | ||
this.autocomplete = new google.maps.places.Autocomplete(this.refs.input, config); | ||
this.autocomplete.addListener('place_changed', this.onSelected.bind(this)); | ||
@@ -27,0 +31,0 @@ } |
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
12687
235