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
364 stars 180 forks source link

Autofill: Wrong suggestion is being selected #506

Closed stiangrim closed 1 year ago

stiangrim commented 1 year ago

When I search for Parkveien 4 and click on the second option (Parkveien 4, 1405 Langhus, Norway) another address which is not in the options is selected (Parkveien 4, 1366 Lysaker, Norway)

For the same search, if I click on the third option, the second option is selected. If I click on the fourth option, the third is selected - and so on.

It seems like there is an "invisible" second option here which causes the bug (Parkveien 4, 1366 Lysaker, Norway).

I'm getting the error using "@mapbox/search-js-react": "^1.0.0-beta.17", but the error can also be reproduced by trying the same search on the MapBox docs example: https://docs.mapbox.com/mapbox-search-js/example/simple-autofill-custom-elements/

(I'm doing the search from Oslo, Norway - if that affects the suggestions I'm getting)

Skjermbilde 2023-09-11 kl  07 37 14

Issue 357 might be related Stack Overflow post which seems related

stiangrim commented 1 year ago

Another example here where clicking on the third option gives me the output of the fourth option.

Skjermbilde 2023-09-11 kl  19 09 48

michalmariasek commented 1 year ago

We have exactly the same issue, It must be a new change as it worked 2 weeks ago. We use this script https://api.mapbox.com/search-js/v1.0.0-beta.17/web.js

When the user select a suggestion item it retrieves either a wrong one or nothing at all. The same behaviour can be tested even on the mapbox test page https://docs.mapbox.com/mapbox-search-js/example/autofill-checkout-react/

steveb85 commented 1 year ago

@stiangrim same for us, did you find a solution?

stiangrim commented 1 year ago

Hi @michalmariasek @steveb85

I've had a call with @ppatternn from MapBox about this and I've been told that the team is working on this bug now and that it will be fixed within this week

steveb85 commented 1 year ago

@stiangrim thanks so much for that information! much appreciated, just short enough we will just live with it.

michalmariasek commented 1 year ago

Thank you, @stiangrim !

mpothier commented 1 year ago

A fix for this bug has been deployed, and the behavior should now be working as expected - thank you @stiangrim and others for reporting on it.

Please note that for future Address Autofill questions or bug reports, the best way to submit feedback is through either our developer Discord channel or our direct feedback submission, both of which can be found from the main documentation page for the Search JS SDK on the right side panel. The mapbox-gl-geocoder repo is not directly related to Address Autofill or its SDK.