smeijer / leaflet-geosearch

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

Suggestions list - enter key different behaviour to click #371

Closed tstibbs closed 9 months ago

tstibbs commented 11 months ago

Selecting a result with the arrow keys and pressing enter should have the same behaviour as clicking on the result (in my opinion).

To reproduce

  1. Visit https://smeijer.github.io/leaflet-geosearch/
  2. Type 'london' into the search box
  3. Wait for suggestions to appear
  4. Click a suggestion - notice that the list of suggestions disappears.
  5. Press the cross to clear the search
  6. Type 'london' in to the search box again
  7. Wait for suggestions to appear
  8. Use arrow keys to select an entry
  9. Press enter

Expected behaviour

On pressing enter, the list of search suggestions should disappear like when you click with the mouse.

Actual behaviour

The list of suggestions remains on screen. It's not entirely obvious how to get rid of them, because clicking on the map doesn't close the list. The only way I can see is to click on the same result again.

Impact

Admittedly minor usability annoyance to those of us that naturally use the keyboard rather than mouse.

Notes

I'm sure this is a simple fix, I'll take a look when I get chance, but first wanted to confirm that this was considered a bug and that there wasn't a reason for this behaviour?

smeijer commented 9 months ago

:tada: This issue has been resolved in version 3.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: