Code Monkey home page Code Monkey logo

vuetify-google-autocomplete's Introduction

Vuetify Google Autocomplete

A Vuetify ready Vue.js (2.x) autosuggest component for the Google Maps Places API.

release

Versions

Latest Beta: 2.0.0-beta.8

Latest Stable: 2.1.2

See releases for details.

Thanks

Huge thanks and credit goes to @olefirenko and contributors for creating Vue Google Autocomplete from which this Vuetify ready version was inspired.

Demo

Live Interactive demo: madimetjashika.github.io/vuetify-google-autocomplete

Installation

The easiest way to use Vuetify Google Autocomplete is to install it from npm or yarn.

npm i vuetify-google-autocomplete

Or

yarn add vuetify-google-autocomplete

For version >= 2.0.0-alpha.2

Within your main.js or Vue entry point, import and initialise the component.

import Vue from 'vue';
import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete';

Vue.use(VuetifyGoogleAutocomplete, {
  apiKey: '...', // Can also be an object. E.g, for Google Maps Premium API, pass `{ client: <YOUR-CLIENT-ID> }`
  version: '...', // Optional
  language: '...', // Optional
  installComponents: true, // Optional (default: true) - false, if you want to locally install components
  vueGoogleMapsCompatibility: false, // Optional (default: false) - true, requires vue2-google-maps to be configured see https://github.com/xkjyeah/vue-google-maps
});

For use with vue2-google-maps

import Vue from 'vue';
import * as VueGoogleMaps from 'vue2-google-maps';
import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete';

// @see https://www.npmjs.com/package/vue2-google-maps
Vue.use(VueGoogleMaps, {
    load: {
        key: 'xxxxxxxxs',
        // This is required to use the Autocomplete plugin
        libraries: 'places', // 'places,drawing,visualization'
    },
});

Vue.use(VuetifyGoogleAutocomplete, {
    /*
      not used as loaded with component
      apiKey: key,
    */
    vueGoogleMapsCompatibility: true,
});

For version <= 1.1.0

This component uses Google Maps Places API to get geo suggests for autocompletion, so you have to include the Google Maps Places API in the <head> of your HTML:

<!DOCTYPE html>
  <html>
  <head><script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE&libraries=places"></script>
  </head>
  <body></body>
</html>

To obtain API key please visit the Google Developer Console. The API's that you have to enable in your Google API Manager Dashboard are Google Maps Geocoding API, Google Places API Web Service and Google Maps Javascript API.

Usage and API

For version >= 2.0.0-alpha.1

Simply start using the component in your HTML.

<vuetify-google-autocomplete
    id="map"
    append-icon="search"
    v-bind:disabled="true"
    placeholder="Start typing"
    v-on:placechanged="getAddressData"
>
</vuetify-google-autocomplete>

For version <= 1.1.0

The Vuetify Google Autocomplete works out of the box by just including it.

import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete'

In your template you can use this syntax:

<vuetify-google-autocomplete
    id="map"
    append-icon="search"
    v-bind:disabled="true"
    classname="form-control"
    placeholder="Start typing"
    v-on:placechanged="getAddressData"
>
</vuetify-google-autocomplete>

Properties

Please refer to the following for a list of all the properties supported by this library:

Events

The component emits the following events, which you can listen in your application:

placechanged

Gets triggered when the address data got obtained. This data is available on the returned objects:

  • street_number, route, locality, administrative_area_level_1, country, postal_code, latitude, longitude.
  • place - PlaceResult object is available as second parameter.

no-results-found

Gets triggered when a user entered the name of a Place that was not suggested and pressed the Enter key, or the Place Details request failed.

Pleae refer to Vuetify text field events for all vuetify supported events.

Exposed component functions

These functions are accessible by setting "ref" on the component (Refs documentation). See example below how to use these functions.

clear()

Call to clear the value of the user input.

focus()

Call focus to focus on the element

blur()

Call blur to blur (unfocus) the element

update(value)

Call to update the user input with a new value

Example

Please note that you need to provide the method that will listen (v-on:placechanged) to for an event when the address data is obtained. In the example below, the method is getAddressData.

<template>
    <div>
        <h2>Your Address</h2>
        <vuetify-google-autocomplete
            ref="address"
            id="map"
            classname="form-control"
            placeholder="Please type your address"
            v-on:placechanged="getAddressData"
            country="sg"
        >
        </vuetify-google-autocomplete>
    </div>
</template>

<script>
    export default {
        data: function () {
            return {
              address: ''
            }
        },
        mounted() {
            // To demonstrate functionality of exposed component functions
            // Here we make focus on the user input
            this.$refs.address.focus();
        },
        methods: {
            /**
            * When the location found
            * @param {Object} addressData Data of the found location
            * @param {Object} placeResultData PlaceResult object
            * @param {String} id Input container ID
            */
            getAddressData: function (addressData, placeResultData, id) {
                this.address = addressData;
            }
        }
    }
</script>

Exposed component slots

The slots available are proxied v-text-field slots.

append

Adds an item inside the input and after input content. (Note in underlying v-text-field this slot overrides append-icon prop.)

append-outer

Adds an item inside the input and after input content. (Note in underlying v-text-field this slot overrides append-outer-icon prop.)

label

Replaces the default label

prepend

Adds an item outside the input and before input content. (Note in underlying v-text-field this slot overrides prepend-icon prop.)

prepend-inner

Adds an item inside the input and before input content. (Note in underlying v-text-field this slot overrides prepend-inner-icon prop.)

progress

Slot for custom progress linear (displayed when loading prop is not equal to Boolean False)

Example

Use slots as you would any other component. Example below uses append which uses a component rather than the append-icon props (note: this defers slot behaviour back to the v-text-field implementation).

<template>
    <div>
        <h2>Your Address</h2>
        <vuetify-google-autocomplete
            ref="address"
            id="map"
            classname="form-control"
            placeholder="Please type your address"
            v-on:placechanged="getAddressData"
            country="sg"
        >
            <template #append>
                <!-- my fancy component rather than a simple icon -->
                <my-btn/>
            </template>
        </vuetify-google-autocomplete>
    </div>
</template>

Contributing

Let's make this an awesome vuetify component! Collaborations and contributions are welcome!

Contribution Guidlines

Have a read through the Contributor Code of Conduct. Pretty standard, nothing hectic.

Fork, then clone the repo:

git clone [email protected]:your-username/vuetify-google-autocomplete.git

Install dependencies with npm

npm install

or yarn

yarn

Make your changes, and observe them at dev-time by running

npm run dev

and going to the displayed URL to see your changes.

Then, ensure tests are written for your changes. Ensure that your changes pass all the tests:

npm run test

Ensure that your changes are documented via JSDocs standard, then run

npm run docs

to update the JSDocs.

If relevant, please ensure that you update the README and demo/example accordingly.

Push to your fork and submit a pull request.

If all is well, your changes will be merged timeously!

Feel free to also post issues for bug fixes or enhancements or anything.

Roadmap

I'm planning on updating this library to support the most latest version of vuetify during the month of December 2019. This would include potentially having this library as a vue cli 3.* supported plugin.

If you've got any requests, please post them via issues and i'll look into them.

PS - I am looking for people to help me maintain this library. The demand has grown since creation and unfortunately i'm unable to support it regularly at an acceptable rate. If you're keen, please drop me a mail me at [email protected].

vuetify-google-autocomplete's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuetify-google-autocomplete's Issues

TypeScript Support

Can you offer any guidance as to how I can use this in a TypeScript project? I've added this typing:

declare module 'vuetify-google-autocomplete' {
  import _Vue from 'vue';
  import VTextField from 'vuetify/lib';
  import { PluginObject, PluginFunction } from "vue/types/plugin";
  export function install(Vue: typeof _Vue, options?: any): void
}

But I'm still getting an error like this: [Vue warn]: Unknown custom element: <v-text-field> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

multiple types

I would like to add multiple types. (address, establishments and (regions))
I believe it works when i submit an array, but it also returns an error.

Could you please fix this? :)

Cheers,

Disable spellcheck

spellcheck should be disabled for the corresponding input to remove the dotted red line in this example (screenshot taken in Chrome on macOS):

disable-autocorrect

And, while you're at it, autocorrect and some other attributes of the input element should be disabled, too:
https://davidwalsh.name/disable-autocorrect

Using vuetify-google-autocomplete with vue-google-maps

Hi @MadimetjaShika,

I'm building a Vue component using vuetify-google-autocomplete and vue-google-maps.
It seems I'm running into trouble as both access the Google Maps API as you suspected in #16:

As noted on the release notes, you might still experience issues if you try to use this component with a different vue component that also loads the Google API. I haven't yet built to cater for that.

I tried using :load-google-api as mentioned in the release notes, without success.

Do you have plans in the near future to make such an integration possible? If not, do you know if there is a workaround?

Edit:
To give you a bit more information and context, the app is using vue-router.
vue-google-maps is initialized globally (Vue.use(...) in main.js) while vuetify-google-autocomplete is initialized locally as a component.
I've noticed that when navigating (using vue-router) from a page that does not include vuetify-google-autocomplete to a page that includes it makes it work properly. Accessing the page directly causes vuetify-google-autocomplete to fail silently. In both cases, vue-google-maps works properly.

Thanks,
Jonathan

enhancement suggestion: separate label from placeholder

I think it would be could to have two separate props for label and placeholder as it is in vuetify v-text-field, instead of having one merged into both, so that we can benefit from the animation that pushes a minimized label on top of the input field, if you see what I mean.

It would help to have a more consistent presentation when one integrate this component in a list of other v-text-fields.

thanks!

Async loading your component and gmaps sdk

Hi, because i do not need your component on the whole application im unable to include google maps in the head.
if you take a look at the vue-gmaps component your can provide a api key for the component and forget about the script loading.
but if anyone wants to use your component anyway its possible like this

components: {
VuetifyGoogleAutocomplete: () => {
        return new Promise((resolve, reject) => {
          if (window.google) {
            resolve(import('vuetify-google-autocomplete'))
          } else {
            let script = document.createElement('script')
            script.onload = () => {
              resolve(import('vuetify-google-autocomplete'))
            }
            script.async = true
            script.src = 'https://maps.googleapis.com/maps/api/js?key=APIKEY&libraries=places'
            document.head.appendChild(script)
          }
        })
      }

unexpected token import

Hi.

When I try to use this cool component into my vue/nuxt project, strange things happen. Here's my error

{ /Users/---/node_modules/vuetify-google-autocomplete/src/index.js:1
(function (exports, require, module, __filename, __dirname) { import VuetifyGoogleAutocomplete from './VuetifyGoogleAutocomplete.js'
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at r (/Users/---/node_modules/vue-server-renderer/build.js:8147:16)
    at Object.<anonymous> (server-bundle.js:3881:18)
    at __webpack_require__ (webpack:/webpack/bootstrap bae7739f6ed7df19984e:25:0)
    at Object.<anonymous> (plugins/vuetify.js:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap bae7739f6ed7df19984e:25:0)
    at Object.<anonymous> (.nuxt/index.js:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap bae7739f6ed7df19984e:25:0)
    at Object.<anonymous> (.nuxt/server.js:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap bae7739f6ed7df19984e:25:0)
    at server-bundle.js:92:18
    at Object.<anonymous> (server-bundle.js:95:10)
    at evaluateModule (/Users/---/node_modules/vue-server-renderer/build.js:8155:21)
    at /Users/---/node_modules/vue-server-renderer/build.js:8213:18 statusCode: 500, name: 'SyntaxError' }

My project.json dependencies looks like follows

"dependencies": {
  "axios": "^0.16.2",
  "body-parser": "^1.17.2",
  "bulma": "^0.5.1",
  "express": "^4.15.3",
  "express-session": "^1.15.3",
  "form-data": "^2.3.1",
  "google-autocomplete-vue": "^1.0.17",
  "nuxt": "^1.3.0",
  "vue": "^2.5.13",
  "vue-i18n": "^7.4.1",
  "vuetify": "^v1.0.0-beta.6",
  "vuetify-cloudinary-upload": "^0.1.1",
  "vuetify-google-autocomplete": "^2.0.0-alpha.1"
},

I tried to use the component globally and related to a page. same error.

tried also a new version of vue (older), but same errors.

If I try to move from a page to the page in which I imported the component, I can see and use the input autocomplete correctly, but if I refresh that page, it throws that error again.

schermata 2018-02-07 alle 17 38 50

Using vuetify-google-autocomplete with vue2-google-maps

I am having issues setting vuetify-google-autocomplete when I am also using vue2-google-maps, I only use the API key when I load google maps.

Apparently the API is not loading correctly on page refresh :/

VuetifyGoogleAutocomplete.js?2bd5:330 Uncaught TypeError: Cannot read property 'setBounds' of null

Selection lost after choosing with mouse

Using version 1.1.0, I get the dropdown with the results
If I choose a result by clicking with the mouse, the result is pasted into the field but then immediately deleted (the field then shows only as much as was typed out)
If I choose using the keyboard (arrow down, enter), the result is pasted and stays correctly

How to repopulate the input field when loading the form

Hello,
I use this Vue component in a create/edit form (using Vuetify v1.0.1).
In "edit" mode, when display the form, I would like to be able to repopulate the input field with any string (typically what the user entered last time but that is just a example).
The input value is handled by the autocompleteText data of the component, but how can I set a value to this field, programmatically, for example in a created or mounted hook, or any component method?

Thanks a lot for your help :)

hideDetails Prop has wrong default value (should be false)

The hideDetails prop in the component is currently set to a default of true whereas the Vuetify standard has a default of false.

I had to hunt down why my error message (triggered via the :rules prop) wasn't showing, and it was this prop.

problem

Hello, do you have any idea, why it is not work under webpackbin.com? or can you create example?
I have error:
Error: Module parse failed: /root/webpack-packager/packages/2790353294/node_modules/vuetify-google-autocomplete/src/VuetifyGoogleAutocomplete.vue Unexpected token (1:0) You may need an appropriate loader to handle this file type. | | <v-text-field | hide-details

prepend-icon not working

Hey! I'm not able to use prepend-icon. Changing prepend to append works as expected, and the icon is appended. It just doesn't want to prepend.

prepend-icon="location_on"

No error is showing in the console.

What could I be doing wrong here?

NPM update reverts to "2.0.0-alpha.1.test.3"

Steps to reproduce:

  • npm update vuetify-google-autocomplete

package.json now lists the package as "^2.0.0-alpha.1.test.3"

Steps to fix:

  • npm remove vuetify-google-autocomplete
  • npm install vuetify-google-autocomplete

Vue CLI 3 SPA need to reload site

I need to reload my SPA site every single time when i change my route. I checked the library. When I remove destroyed: function destroyed() { window.vgaMapState.initMap = false }, everything works fine.

@MadimetjaShika can you explain this piece of code?

Regards,
Szymon

How to populate a value from the server?

So i use this awesome component to create and edit a model. So in the creation form it all works like a charm. However, in the edit form i would like to populate the current value of the model into the vuetify-google-autocomplete
I tried :value, v-model and the $refs.address.update() to set the initial value to the field but it doesnt work at all. Any ideas?

':append-icon-cb' is deprecated

Warning message I get when using 'append-icon-cb' prop: [Vuetify] ':append-icon-cb' is deprecated, use '@click:append' instead.

Here's my package.json
"dependencies": { "vuetify": "^1.5.13", "vuetify-google-autocomplete": "^2.0.0-beta.6" }

I change to use '@click:append', I get a different error:
'DOMException: Failed to execute 'setAttribute' on 'Element': '@click:append' is not a valid attribute name.'

Thanks
PL

Refresh the country filter

I have the country attribute pointing to my model: :country="form.step1.contact.country.toLowerCase()"

form.step1.contact.country.toLowerCase() change the value based on a dropdown.

Based in the Vue debugger, form.step1.contact.country.toLowerCase() value is correct, for instance 'es' - however the filter seems to be working only on load time, no if you modify it afterwards.

Any ideas?

Validation doesn't work

Hi I have a problem with validation on blur, i would like to validate vuetify-google-autocomplete, but nothing heppens
Here is my html

<vuetify-google-autocomplete append-icon="search" :clearable="true" :country="['PL']" :rules="rules" :disabled="disabled" :validateOnBlur="true" :enable-geolocation="false" label="Wyszukaj adres" :required="true" v-on:placechanged="onPlaceChanged"> </vuetify-google-autocomplete>

Actual Map

Hello guys. Beginner here.
How can we see the actual map?

Maybe debounce the google request to reduce API load?

So when you start typing the address, each new key triggers a request to google API. As the API is limited, probably many would prefer a somehow debounced search like with lodash/debounce. This would cause the search to wait a few hundred milliseconds before the search starts and delays it, if another key is put into search. Therefore the number of requests would be reduced drastically.

Any chance you can implement this?

Can't change Types

The types prop doesn't seem to work.

The default address works fine, but when you change it to anything else the autocomplete stops working with no errors.

Add a loading indicator while searching

It's built in via vuetify text input. Let's use it.

NOTE: this should be a composite attribute with the loading passed in. I have a need where I want to to show loading for an outside event as well as the internal search.

failed to compile

npm i vuetify-google-autocomplete

./node_modules/vuetify-google-autocomplete/lib/helper.js
Module not found: Error: Can't resolve

Filter returned data based on a specific city?

Great plugin! everything works beautifully. I am just wondering if there is anyway to set restrictions on returning data to only be within a specific city/state? So if a user inputting a zip code the api is only going to return zip codes that fall within that specified city or location.... Thanks!

Getting a focus or blur of undefined

Hi, great package you have made - thank you.

I am receiving: "[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'focus' of undefined"

at VueComponent.focus (webpack-internal:///895:293)
at VueComponent.boundFn [as focus] (webpack-internal:///4:192)
at VueComponent.mounted (webpack-internal:///474:256)
at callHook (webpack-internal:///4:2894)
at Object.insert (webpack-internal:///4:4089)
at invokeInsertHook (webpack-internal:///4:5863)
at VueComponent.patch [as __patch__] (webpack-internal:///4:6082)
at VueComponent.Vue._update (webpack-internal:///4:2646)
at VueComponent.updateComponent (webpack-internal:///4:2764)
at Watcher.get (webpack-internal:///4:3114)

The first which take me to:

    /**
     * Focus the input
     */
    focus: function focus() {
      this.$refs.autocomplete.focus();
    },

The package is working great on a single usage, but it still throws out this error. When I have it in a v-for loop in order to edit the addresses, then the input does not work at all and I suspect it has got to do with the mount:

mounted: function () {
  this.$refs.address.focus();
},

Is there any workaround not to use refs?
Thank you in advance.

Include all types

The types prop works just fine, and you can change it to 'address', establishment, (regions) and etc.
However, is there a way to include multiple types?

[Bug] - When using the "clearable" option placechanged isn't triggered

When using the vuetify clearable option, when you click the clear button it clears out the value, but the placechanged callback isn't fired.

On top of that, the inputChange event never seems to fire. I was going to try to hack around that and see if it'll give me something to listen to an evaluate for nothing. But alas, that doesn't work either.

Unknown custom element: <v-text-field>

Hi - Adding your component to my vuetify project gives the following error in the browser:

Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

This is found in

And no component is show at all on the DOM

The version is: "vuetify-google-autocomplete": "^2.0.0-beta.5"

How to use with vuetify Simple HTML template?

I'm working on an app that will be embedded in an existing website. Since I'm not using webpack, I keep running into 'unexpected token import/export' errors - no matter how I split the code up or try to import it to my app.

Any thoughts on an html/non-npm setup? What needs to go where?

Feature Request: setting default value

Passing a prop down to set the initial value on the input. Oddly, it's not listed in the API documentation for the component, but it's used within the examples.

No drop down to choose locations

Using this on a SPA built with Vue CLI 3. Neither stable version supplies a dropdown of choices.

On further investigation, none of the vuetify components using dropdowns (select, datatable, etc.) show the drop down or show it absurdly displaced away from the component.

Too bad, both Vuetify and this package would be stellar if they were usable (due to the dropdown issue).

Nuxt and window is not defined error

Looking to include this as a plugin in Nuxt and getting a window is not defined error. This is my plugin file

import Vue from 'vue';
import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete';

Vue.use(VuetifyGoogleAutocomplete, {
  apiKey: 'the-key'
});

It appears the error is at window.vgaMapState = {...} and most likely window.initVGAMaps = function(...) in index.js

Should also note that the error doesn't come up during compile, but rather when loading the page the vuetify-google-autocomplete is used on

Api key requested as prop in the aplha version

I would like to know what's the best approach to pass the API key only once? Right now every time I'm invoking the component I'm passing the API key prop. This gives an error if you try to have more than one input.

I did the below to make it work, but I don't think that's what is intended with your code:
VuetifyGoogleAutocomplete.props.googleApiKey = {type: String, default: 'myapikey'}; Vue.component('vuetify-google-autocomplete', VuetifyGoogleAutocomplete);

And I still get the error below if I use more than one autocomplete in the same page:
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.

Thanks!

Input not being updated

Once an address is selected the input doesn't update with the full address.

Here is my component

<vuetify-google-autocomplete ref="address" id="map" append-icon="search" placeholder="Address" v-on:placechanged="getAddressData">
</vuetify-google-autocomplete>
getAddressData(addressData, placeResultData, id) {
      if (placeResultData) {
        this.address = placeResultData.formatted_address;
      }
    },

If I start typing let's say 15565 and the address list pops up and I select an address the function gets called the address variable gets set but in the UI the input doesn't update with the full address it just stays 15565

Initial location data

Firstly, thanks for the great work 🥂
Now, I am to use this component as a part of user profile of a website.

So, I want the field to have an initial data (i.e. the currently registered place) when the user wants to edit his/her location info -if exists. Now,

  • Is it doable already?
  • Would it be added?
  • Or such a kind of feature is out of scope of this?

:placechanged not being triggered

Just downloaded the Alpha4 version and see a breaking change that is causing :placechanged not to trigger.

<vuetify-google-autocomplete google-api-key="key" id="map" prepend-icon="location_on" label="Meeting location" types="address" value="test" :enable-geolocation="true" :placechanged="getAddressData"> </vuetify-google-autocomplete>

getAddressData(addressData, placeResultData, id) { console.log('something')}

Interestingly, Vue gives me a required-prop error if I don't specify a value...

No "keydown" event support

There doesn't seem to be any support for the "keydown" event, which would be used for detecting events on the backspace button.
I need to detect the backspace key press but the keypress event only picks up character (printable) keys.

Can we use hint?

I tried to use :hint or hint, but neither seemed to work. Any simple solution to implement that?

value not updating when place changes

_this2.autocompleteText = document.getElementById(_this2.id).value;

value in this code is not updated upon getting a new place. Not sure my implementation is correct or not but when selecting an option the text does not update in the input.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.