trailheadlabs / outerspatial-map-library

A Leaflet plugin built for use in OuterSpatial
https://www.trailheadlabs.com/labs/outerspatial-map-library/
Other
6 stars 1 forks source link

Hitting the "Enter" key when the geocoderControl textfield is focused searches twice #152

Closed nateirwin closed 6 years ago

ryanjhodge commented 6 years ago

So currently, if i type in a word and press enter, then a geocode provider search is performed. Is that the behavior we want to avoid? This also happens when the magnifying glass is clicked.

On enter keydown event, should we check if there are any search results, and if so select the first result instead of sending the geocode request. or perhaps move the focus to the search list?

nateirwin commented 6 years ago

We definitely want "Enter" to perform a geocode search. But currently hitting "Enter" does two geocode searches. It isn't evident from the UI, but if you add a breakpoint where the geocode search is executed, you should see the problem.