Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gmaps-places-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmaps-places-autocomplete - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

51

lib/index.js

@@ -55,5 +55,4 @@ "use strict";

handleInputChange: {
value: function handleInputChange() {
var userInput = React.findDOMNode(this.refs.geosuggestInput).value;
this.setState({ userInput: userInput });
value: function handleInputChange(e) {
this.setState({ userInput: e.target.value });
}

@@ -104,2 +103,23 @@ },

},
handleSuggestSelect: {
value: function handleSuggestSelect(suggest) {
if (!suggest) {
suggest = {
label: this.state.userInput
};
}
this.setState({
isSuggestsHidden: true,
userInput: suggest.label
});
if (suggest.location) {
this.props.onSuggestSelect(suggest);
return;
}
this.geocodeSuggest(suggest);
}
},
updateSuggests: {

@@ -151,23 +171,2 @@ value: function updateSuggests(suggestsGoogle) {

},
selectSuggest: {
value: function selectSuggest(suggest) {
if (!suggest) {
suggest = {
label: this.state.userInput
};
}
this.setState({
isSuggestsHidden: true,
userInput: suggest.label
});
if (suggest.location) {
this.props.onSuggestSelect(suggest);
return;
}
this.geocodeSuggest(suggest);
}
},
geocodeSuggest: {

@@ -206,3 +205,3 @@ value: function geocodeSuggest(suggest) {

isActive: isActive,
onSuggestSelect: _this.selectSuggest
onSuggestSelect: _this.handleSuggestSelect
});

@@ -216,3 +215,3 @@ });

"div",
{ className: "geosuggest", onClick: this.onClick.bind(this) },
{ className: "geosuggest" },
React.createElement("input", {

@@ -219,0 +218,0 @@ className: "geosuggest__input",

{
"name": "gmaps-places-autocomplete",
"version": "0.1.1",
"version": "0.1.2",
"description": "A React autosuggest input for the Google Maps Places API.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,6 +29,5 @@ import React from 'react';

handleInputChange() {
let userInput = (React.findDOMNode(this.refs.geosuggestInput)).value;
this.setState({userInput: userInput});
}
handleInputChange(e) {
this.setState({userInput: e.target.value});
}

@@ -68,2 +67,22 @@ handleInputFocus() {

handleSuggestSelect(suggest) {
if (!suggest) {
suggest = {
label: this.state.userInput
};
}
this.setState({
isSuggestsHidden: true,
userInput: suggest.label
});
if (suggest.location) {
this.props.onSuggestSelect(suggest);
return;
}
this.geocodeSuggest(suggest);
}
updateSuggests(suggestsGoogle) {

@@ -113,23 +132,3 @@ let suggests = [];

selectSuggest(suggest) {
if (!suggest) {
suggest = {
label: this.state.userInput
};
}
this.setState({
isSuggestsHidden: true,
userInput: suggest.label
});
if (suggest.location) {
this.props.onSuggestSelect(suggest);
return;
}
this.geocodeSuggest(suggest);
}
geocodeSuggest(suggest) {
geocodeSuggest(suggest) {
this.state.geocoder.geocode({

@@ -160,3 +159,3 @@ address: suggest.label

isActive={isActive}
onSuggestSelect={this.selectSuggest}
onSuggestSelect={this.handleSuggestSelect}
/>

@@ -169,3 +168,3 @@ );

return (
<div className="geosuggest" onClick={this.onClick.bind(this)}>
<div className="geosuggest">
<input

@@ -172,0 +171,0 @@ className="geosuggest__input"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc