New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-google-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-autocomplete - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

2

docs/examples.js

@@ -70,3 +70,3 @@ import React, { FC, RefObject, useRef, useState } from "react";

inputComponent={({ inputRef, onFocus, onBlur, ...props }) => (
<AutocompleteComponent
<Autocomplete
apiKey={process.env.REACT_APP_GOOGLE}

@@ -73,0 +73,0 @@ {...props}

@@ -80,7 +80,10 @@ "use strict";

autocompleteRef.current = new google.maps.places.Autocomplete(inputRef.current, config);
event.current = autocompleteRef.current.addListener("place_changed", function () {
if (onPlaceSelected && autocompleteRef && autocompleteRef.current) {
onPlaceSelected(autocompleteRef.current.getPlace(), inputRef.current, autocompleteRef.current);
}
});
if (autocompleteRef.current) {
event.current = autocompleteRef.current.addListener("place_changed", function () {
if (onPlaceSelected && autocompleteRef && autocompleteRef.current) {
onPlaceSelected(autocompleteRef.current.getPlace(), inputRef.current, autocompleteRef.current);
}
});
}
};

@@ -87,0 +90,0 @@

{
"name": "react-google-autocomplete",
"version": "2.7.0",
"version": "2.7.1",
"description": "React component for google autocomplete.",

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

@@ -147,3 +147,3 @@ ![](/docs/example.gif)

if (placePredictions.length)
service.placesService?.getDetails(
placesService?.getDetails(
{

@@ -150,0 +150,0 @@ placeId: placePredictions[0].place_id,

@@ -72,15 +72,17 @@ import React, { useEffect, useRef, useCallback } from "react";

);
event.current = autocompleteRef.current.addListener(
"place_changed",
() => {
if (onPlaceSelected && autocompleteRef && autocompleteRef.current) {
onPlaceSelected(
autocompleteRef.current.getPlace(),
inputRef.current,
autocompleteRef.current
);
if(autocompleteRef.current) {
event.current = autocompleteRef.current.addListener(
"place_changed",
() => {
if (onPlaceSelected && autocompleteRef && autocompleteRef.current) {
onPlaceSelected(
autocompleteRef.current.getPlace(),
inputRef.current,
autocompleteRef.current
);
}
}
}
);
);
}
};

@@ -87,0 +89,0 @@

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