leaflet-geosearch icon indicating copy to clipboard operation
leaflet-geosearch copied to clipboard

Locate autocomplete above input

Open justice47 opened this issue 6 years ago • 2 comments

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?

justice47 avatar Jun 13 '19 08:06 justice47

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

smeijer avatar Jun 13 '19 11:06 smeijer

@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.

justice47 avatar Jun 13 '19 12:06 justice47