maplibre / maplibre-gl-geocoder

Geocoding for MapLibre
ISC License
45 stars 17 forks source link

Geocoder requiring input to be cleared before searching for entire set of places after a single result search #73

Closed thaddmt closed 2 years ago

thaddmt commented 2 years ago

Dupe of https://github.com/aws-amplify/amplify-ui/issues/1797

Bug was discovered in the amplify-ui repo which wraps the maplibre-gl-geocoder component

Please describe your bug.

I'm using the Geocoder component, and I'm seeing an issue where I can't search for another set of places after clicking on a single result from the search result container. The issue does not happen if I clear the input of the search box before performing a search for the set of places so it is a minor bug.

What's the expected behaviour?

The search box should continue to allow searching for a new set of places, after clicking on a single result, without having to clear the content of the search box.

Help us reproduce the bug!

Type in "ATM" in the search box and hit "Enter" on the keyboard The map should display markers for a set of ATMs Click on the first result from the search result container The map should display a single marker for the first result's ATM Highlight the entire text and type in "Grocery Store" (highlighting entire text and overwriting it with "Grocery Store" will prevent it from clearing the input) Hit "Enter" on the keyboard Nothing will happen

wipfli commented 2 years ago

Thanks for the bug report. I tried to reproduce the behavior with the demo at npm start but I think that demo does not have the correct query logic. Can you maybe have a look at the npm start page and see if you can reproduce the bug with what is there? Or maybe we could have a new demo page which uses a publicly available geocoder like nominatim or so?

thaddmt commented 2 years ago

@wipfli I'm actually able to reproduce it in the mock API sample app. Two gifs posted below

Gif 1 (current) - After typing in a search query and selecting on london I highlight the full query (cmd+a) then type new query and hit Enter but nothing happens

asdf

Gif 2 (proposed bug fix) - After typing in a search query and selecting on london I highlight the full query (cmd+a) then type new query and hit Enter a new query occurs (returns the same result because it's a mocked result) and the screen flies to view all results

zxcv