mapbox / mapbox/mapbox-gl-geocoder

Bug: function SetInput() when option showSuggestions is set to false, it still shows the suggestions

Open
#522 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

The code:

const geocoder = new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
mapboxgl: mapboxgl,
});

if (locationFromUrl && idFromUrl) {
// Reverse geocode to get the place name
reverseGeocode(locationFromUrl[0], locationFromUrl[1], placeIdFromUrl).then(placeName => {
if (placeName) {
geocoder.setInput(placeName, false);
}
});
}

The result:
![Screenshot 2023-12-20 at 13 40 09](https://github.com/mapbox/mapbox-gl-geocoder/assets/148454049/6088b565-581c-4a72-b6de-51ec5d0de202)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the geocoder control's setInput function and the handling of the showSuggestions option. Reproduce the supplied MapboxGeocoder example with showSuggestions set to false, then verify that calling setInput does not display suggestions while preserving the input value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.