mapbox / mapbox-gl-geocoder

Geocoder control for mapbox-gl-js using Mapbox Geocoding API
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/
ISC License
368 stars 180 forks source link

Typing semicolon in the geocoder causes an error #408

Closed jakub-leszczynski closed 3 years ago

jakub-leszczynski commented 3 years ago

Hey!

The easiest way to reproduce is to:

  1. Navigate to geocoder example page here: https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/
  2. Open the console to see error message
  3. Type anything followed by a semicolon.
  4. See the following message: Screenshot 2020-12-29 at 16 20 59 (2) Screenshot 2020-12-29 at 16 20 46 (2)

I've been trying other signs but only the semicolon seems to be causing the issue. I've also been able to reproduce this locally.

andrewharvey commented 3 years ago

352 was mostly for where a coordinate pair would create an error, but it could apply here. All we could do on the mapbox-gl-geocoder side is try and detect an error before the call is made and not make the call. Otherwise what else would you expect to happen here?