Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions are displayed after setting a default input #118

Open
victorneuret opened this issue Jul 9, 2021 · 3 comments
Open

Suggestions are displayed after setting a default input #118

victorneuret opened this issue Jul 9, 2021 · 3 comments

Comments

@victorneuret
Copy link

I had been working with the Geocoder outside of the map.
When I set the input value, the Geocoder is loaded with it's suggestions and they do not collapse until i clic on the geocoder and then clic out.
I would like to know how to load the geocoder without the suggestions until the user select the geocoder.
I may have done something wrong. Here is how I have done it: https://codesandbox.io/s/pedantic-gauss-hhdrl?file=/src/App.js

@SamSamskies
Copy link
Owner

It didn't use to do that. Unfortunately, mapbox-gl-geocoder changed the behavior mapbox/mapbox-gl-geocoder#401. You might be able use some CSS wizardry to hack around this. Like maybe hide the suggestions unless the input is focused or something.

It might be worth it to roll your own geocoder component to fully customize how it works. You could fetch the data using the Mapbox API and then hook that up to your custom component.

@SamSamskies
Copy link
Owner

You could also try rolling back to v2.0.13 which I think was using a version of mapbox-gl-geocoder that didn't display the suggestions when setting the input value.

@victorneuret
Copy link
Author

Thanks for your answer. I understand that it is not possible for you to fix anything within this package. I'll see what I can do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants