smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.04k stars 273 forks source link

Locate autocomplete above input #191

Open justice47 opened 5 years ago

justice47 commented 5 years ago

Hello! That would be nice to have a feature to locate autocomplete block above the input field, and remain the input field sticky to its position. For example this is must-have feature for an input located at the very bottom of the map. Can we achieve this only with HTML and CSS?

smeijer commented 5 years ago

I guess this would be possible by simply overriding the styles with css. Are you experiencing difficulties somewhere?

justice47 commented 5 years ago

@smeijer thanks for a quick reply! Yes, I can't find an example which utilize this behaviour elsewhere. I found only this example with JQuery, but it's semantic are far from leaflet-geosearch structure. What we must achieve is:

  1. Change the sequence of elements, make autocomplete appears before input (we probably can make it with CSS, but I've done that with a few tweaks inside render function in leaflet-geosearch files)
  2. Make input fixed, do not allow it to slide lower than it default position then autocomplete box appears
  3. Change the sequence of items inside autocomplete box to make more preffered options closer to input field.

For now on I've dealed only with first point.