No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Google autocomplete places with q-input

    Help
    4
    6
    1166
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mauri last edited by

      Hi! I want to have autocomplete places google inside q-input, with input tag it works well but i can’t get it works with q-input. Any ideas?
      Captura de pantalla de 2019-04-22 16-56-24.png

      Captura de pantalla de 2019-04-22 16-58-10.png

      Thanks!

      1 Reply Last reply Reply Quote 0
      • M
        mKomo last edited by mKomo

        Hi, maybe give QSelect a go instead of q-input,

        see: QSelect-autocomplete

        you can always make it look like a normal input field if you like

        or for greater customization you can make your own field with the QField wrapper

        M 1 Reply Last reply Reply Quote 0
        • M
          Mauri @mKomo last edited by

          @mKomo said in Google autocomplete places with q-input:

          Hi, maybe give QSelect a go instead of q-input,

          see: QSelect-autocomplete

          you can always make it look like a normal input field if you like

          or for greater customization you can make your own field with the QField wrapper

          Thanks! I’m going to try this

          1 Reply Last reply Reply Quote 0
          • R
            Rohit last edited by

            @Mauri what solution did work for you

            1 Reply Last reply Reply Quote 0
            • R
              Rohit last edited by Rohit

              Here is the solution that worked for me without any package.
              it might help some one.
              <template>
              <q-input
              ref=“autocomplete”
              filled
              v-model=“user.address”
              label=“Physical Address”
              for=“address” //id attribute
              hint=“Your permanent address”
              :rules="[val => !!val || ‘This field is required.’]"
              />
              </template>

              and in mounted
              <script>
              mounted() {
              this.autocomplete = new google.maps.places.Autocomplete(
              // (this.$refs.autocomplete),
              (document.getElementById(“address”)),
              {types: [‘geocode’]}
              );
              this.autocomplete.addListener(‘place_changed’, () => {
              let place = this.autocomplete.getPlace();
              let ac = place.address_components;
              console.log(ac);
              }
              });
              <script>

              1 Reply Last reply Reply Quote 1
              • N
                nulele last edited by

                For anybody has trouble showing the dropdown list on cordova app, the problem for me was the css. I solved with this instruction:

                .pac-container {
                z-index: 9999 !important;
                }

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post