AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

Feature Request: Hide default geocoder input automatically when custom input is given #70

Open jackiepapers opened 9 months ago

jackiepapers commented 9 months ago

If I try to use my own input for MapboxCustomGeocoder it shows my input plus the original input.

<MapboxCustomGeocoder
      @change="geocode"
      v-model="result"
      :options="{
        countries: 'ca',
        proximity: 'ip', 
        bbox: [-123.292497, 49.004327, -119.012364, 49.379078],
      }"
    >
      <TextInput placeholder="Search" />
    </MapboxCustomGeocoder>
AlexLavoie42 commented 9 months ago

This is done intentionally to allow you add your own input that maps directly to the geocoder.

I'm curious what behavior you are expecting/require?

jackiepapers commented 9 months ago

I was expecting only my custom input to be visible and that the whole thing would behave as a single input.

AlexLavoie42 commented 9 months ago

That was the original idea, but it is very hard to hide the original geocoder input while keeping the dropdown (it is definitely possible, but implementing in the module is very difficult without breaking things.)

Unfortunately you will have to do some CSS hacks to hide the input yourself at this time. I may come back to this in the future though since I think I may be able to make it work with a Teleport.

jackiepapers commented 9 months ago

I guess I was trying to use it as an address autofill which isn't really it's intended purpose.

Gonzalo-Bruna commented 6 months ago

No updates on this? I was thinking on implementing the input aside of the map, as seen here:

image